I just put the finishing touches on some Perl code that reads info from Photoshop jpeg files but when trying to package it up inside a subroutine, I'm having trouble using the input variable.

For example in the naked code I wrote:
open(PROPS, 'egrep -a \'<photoshop:([^>]+)>[^<]*</photoshop:\1>\' "file.jpg" | ');


but when trying to package inside subroutine like so:

sub GetPhotoInfo($inPhotoPath)
{
open(PROPS, 'egrep -a \'<photoshop:([^>]+)>[^<]*</photoshop:\1>\' $inPhotoPath | ');
}


The script just hangs (seems like it's waiting for standard input from the keyboard):

Also tried the dot operator to build the expression out of the input and it's constituent parts, but got the same result.

How does one actually use passed in variables in Perl?

Thanks

Ken


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to