From: "shawn wilson"
> On Aug 16, 2011 9:48 PM, "John W. Krahn" wrote:
>>
>> Joseph L. Casale wrote:
>>>
>>> What is the correct way to quickly assign the result of a regex against
>>> a cmdline arg into a new variable:
>>>
>>> my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
>>
>>
>> my ( $var ) = $ARGV[
At 11:43 PM -0400 8/16/11, shawn wilson wrote:
On Aug 16, 2011 9:48 PM, "John W. Krahn" wrote:
Joseph L. Casale wrote:
What is the correct way to quickly assign the result of a regex against
a cmdline arg into a new variable:
my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
my ( $var ) = $AR
On Aug 16, 2011 9:48 PM, "John W. Krahn" wrote:
>
> Joseph L. Casale wrote:
>>
>> What is the correct way to quickly assign the result of a regex against
>> a cmdline arg into a new variable:
>>
>> my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
>
>
> my ( $var ) = $ARGV[0] =~ /(.*)foo/i;
IIRC, that rede
Joseph L. Casale wrote:
What is the correct way to quickly assign the result of a regex against
a cmdline arg into a new variable:
my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
my ( $var ) = $ARGV[0] =~ /(.*)foo/i;
John
--
Any intelligent fool can make things bigger and
more complex... It takes a
>Yes, you can use:
>
>( my $var = $ARGV[0] ) =~ s/(.*)foo/$1/i;
Rob/Octavian,
Thanks for the quick help!
jlc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
From: "Joseph L. Casale"
What is the correct way to quickly assign the result of a regex against
a cmdline arg into a new variable:
my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
Obviously that's incorrect but is there a quick way without intermediate
assignment?
Thanks!
jlc
Yes, you can use:
( my
On Tue, Aug 16, 2011 at 8:27 PM, Joseph L. Casale wrote:
> What is the correct way to quickly assign the result of a regex against
> a cmdline arg into a new variable:
>
> my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
>
> Obviously that's incorrect but is there a quick way without intermediate
> assign
What is the correct way to quickly assign the result of a regex against
a cmdline arg into a new variable:
my $var = ($ARGV[0] =~ s/(.*)foo/$1/i);
Obviously that's incorrect but is there a quick way without intermediate
assignment?
Thanks!
jlc
--
To unsubscribe, e-mail: beginners-unsubscr...@pe
Hi All,
I'm new to the list and know more php than perl. I can read perl and
understand some of it. One problem I seem to be facing is variable
assignment and keeping the variables from script to script. In php this
is fairly easy by assigning the global to the variable.
I'm not s
[EMAIL PROTECTED] wrote:
this does have to run on multiple servers so that is a concern, but all
servers are identical in everyway
This is where Yoda sez: "So sure are you?"
--
_Sx_ http://youve-reached-the.endoftheinternet.org/ _
perldoc -qa.a | perl -lpe '($_)=m("(.*)")' | grep Martian
--
On Mar 23, 2004, at 9:12 AM, [EMAIL PROTECTED] wrote:
>> Hello,
>>
>> I have some code that is using backticks, executing commands on the
>> korn
>> shell.(if that matters). Most work as expected and i get the output
>> of the
>> shell command assigned to the variable left of the argument, like
> Hello,
>
> I have some code that is using backticks, executing commands on the korn
> shell.(if that matters). Most work as expected and i get the output
of the
> shell command assigned to the variable left of the argument, like with
this
> ls command and 'db2 connect' command.
>
> $is
On Mar 23, 2004, at 9:12 AM, [EMAIL PROTECTED] wrote:
Hello,
I have some code that is using backticks, executing commands on the
korn
shell.(if that matters). Most work as expected and i get the output
of the
shell command assigned to the variable left of the argument, like with
this
ls comma
Hello,
I have some code that is using backticks, executing commands on the korn
shell.(if that matters). Most work as expected and i get the output of the
shell command assigned to the variable left of the argument, like with this
ls command and 'db2 connect' command.
$is_dump = `ls $root_
14 matches
Mail list logo