;
but it unable to match. any suggestions.
Thanks.
ciwei
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
uot;\n" if /(\w+)\s+file$/'
first
second
third
now try use rename
# ls -1 | perl -ne 'rename $_ , $1 if /(\w+)\s+file$/'
won't work, like nothing happed? why?
Thanks in advance.
ciwei
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
hostA>ls
SUNWjassVRTSVRTSicsco VRTSvcs
emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm
hostA>ls | perl -en 'print if /SUNW/'
return nothing , while
hostA>ls | perl -ne 'print if /SUNW/'
SUNWits
SUNWjass
SUNWmlib
SUNWrtvc
so why the order of -n -e switch mak
Question from a newbie: how to properly use space
when reference to variables, array, hash etc.
please see the code below:
why the first line, second, and third line all output differiently.
thanks.
ciwei
code below ==
#!/usr/bin/perl
my %ttys =();
open ( WHO, "who|") o
thanks for the reply. I was not able to figure out how the code
works. I have commented the code below. can you help
explain it a bit? thanks.
On Jan 10, 9:41 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> > __DATA__
> > DEV01-HBA0_DMX1-13CA <-- begin of record
> >
> push @{ $wwn{ "$host-$hba" } }, /^\s+WWN:\s+(1000[0-9a-fA-F]{12})$/;
Thanks for the help.
can you please explain in the above line , what the { } around
push @{ $wwn ... } <--here do ?
is the { } here optional? or can this be subsitute with ( )?
thanks.
--
To unsubscribe, e-mail: [EMAIL
Thanks for answering my question.
> I don't understand your second question, could you break your input
> into records so we can clearly see what how you want to define the
> records?
My data looks like this: the rcord is variable in the number of
lines.
I'm tring to push all WWN that start with 1
st be array (not hash elem) at ./
emc_parse_switch_zone.pl line 20, near "$1 if"
Execution of ./emc_parse_switch_zone.pl aborted due to compilation
errors.
so my questions:
1. what is wrong with push here?
2. how to properly determine the boundaris of the records. each
record ending with the las