On 3/23/06, Kevin Old <[EMAIL PROTECTED]> wrote:
> Here's what I have.
>
> # Open js file
> open JSFILE, "$ARGV[0]" or die "can't open file: $ARGV[0]";
> my $js = do { local( $/ ); };
> close JSFILE;
>
> # Clean js
> $js =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi;
> $js =~ s/\s*}\s*$//g
I've gotta run, but maybe this is a place to
start.
-Original Message-----
From: Kevin Old [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 23, 2006 11:35 AM
To: Timothy Johnson
Cc: Perl Beginners
Subject: Re: Javascript Regex to Perl Regex
Here's what I have.
# Clean js
$js =~ s/^\
Here's what I have.
# Open js file
open JSFILE, "$ARGV[0]" or die "can't open file: $ARGV[0]";
my $js = do { local( $/ ); };
close JSFILE;
# Clean js
$js =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi;
$js =~ s/\s*}\s*$//gi;
# Write new js file
open JSOUTFILE, ">out_$ARGV[0]" or die "can
At first glance it looks like this should work:
$fcode =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi;
but I don't have any code to test it on. What do you expect to happen,
and what is really happening?
-Original Message-
From: Kevin Old [mailto:[EMAIL PROTECTED]
Sent: Thu