Plankton has asked for the wisdom of the Perl Monks concerning the following question:
the input line might look like ...while ( <FH> ) { my ( $part1, $junk ) = split /#/; my ( $junk2, $ipaddr ) = split / /, $part1;
... The thing I can't figure out is how to access the result of split as an array without having to declare and assign it to a variable. You know ...client 127.0.0.1#47560: query: host.example.com IN AAAA +
... something like that right?print @(split /#/)[1];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split split
by locked_user sundialsvc4 (Abbot) on Jun 23, 2009 at 16:10 UTC | |
|
Re: split split
by davorg (Chancellor) on Jun 23, 2009 at 16:03 UTC | |
|
Re: split split
by suaveant (Parson) on Jun 23, 2009 at 16:17 UTC | |
|
Re: split split
by oko1 (Deacon) on Jun 23, 2009 at 16:21 UTC | |
|
Re: split split
by artist (Parson) on Jun 23, 2009 at 21:56 UTC | |
|
Re: split split
by moritz (Cardinal) on Jun 23, 2009 at 16:05 UTC | |
|
Re: split split
by toolic (Bishop) on Jun 23, 2009 at 16:12 UTC | |
|
Re: split split
by FunkyMonk (Bishop) on Jun 23, 2009 at 19:05 UTC | |
|
Re: split split
by Marshall (Canon) on Jun 23, 2009 at 17:36 UTC | |
|
Re: split split
by linuxer (Curate) on Jun 23, 2009 at 17:42 UTC |