: -----Original Message-----
: From: Ken Tozier [mailto:[EMAIL PROTECTED]
: Sent: Friday, May 30, 2003 3:18 AM
: To: [EMAIL PROTECTED]
: Subject: Newbie not getting expected values from s/// operator
:
:
: I wrote a simple script to extract some of the info Photoshop
: 6 embeds
: in jpeg files through the "file info" dialog box and find that I can
: extract the info no problem with:
:
: open(PROPS, 'egrep -a \'<photoshop:([^>]+)>[^<]*</photoshop:\1>\'
: "botanical-garden12-full.jpg" | ');
:
: Doing print <PROPS>; shows that the info I'm looking for is indeed
: extracted.
:
: Next I try to loop through the results and extract parts of
: each string
: like so:
:
: $tmp = "";
: while (<PROPS>)
: {
: $tmp .= s/<photoshop:([^>]+)>([^<]*)/$1: $2/;
Substitution searches a string for a pattern, and if
found, replaces that pattern with the replacement text
and returns the number of substitutions made. Otherwise
it returns false (specifically, the empty string).
: }
:
: Doing a "print" on $tmp, yeilds
:
: 1111111111111
Which means there was 1 replacement on each pass.
my $tmp;
while ( <PROPS> ) {
$tmp .= $_ if s/<photoshop:([^>]+)>([^<]*)/$1: $2/;
}
HTH,
Charles K. Clarkson
--
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]