CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [SSBN743] Pass Aurgment When sub is called in menu: Edit Log



FishMonger
Veteran / Moderator

May 4, 2016, 7:54 AM


Views: 6524
Re: [SSBN743] Pass Aurgment When sub is called in menu


Code
#!/usr/bin/perl 

use strict;
use warnings FATAL => 'all';
use IO::Prompter;

my @source = ( qw(src1 src2 src3) );
my @dest = ( qw(dest1 dest2 dest3) );
my @port = ( qw(port1 port2 port3) );

my $src = prompt 'Source IP', -menu => \@source;
my $dest = prompt 'Destination IP', -menu => \@dest;
my $port = prompt 'Port', -menu => \@port;

print "$src $dest:$port";


c:\test>Perl-1.pl

Code
Source IP 
a. src1
b. src2
c. sr3

a
Destination IP
a. dest1
b. dest2
c. dest3

b
Port
a. port1
b. port2
c. port3

c
src1 dest2:port3



(This post was edited by FishMonger on May 4, 2016, 7:58 AM)


Edit Log:
Post edited by FishMonger (Veteran) on May 4, 2016, 7:58 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives