For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > March 2005 > Re: reg exp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: reg exp
John Doe

2005-03-07, 8:56 pm

Am Montag, 7. M=E4rz 2005 19.54 schrieben Sie:
> is this line
>
> :> $_=3D~s{delete}{};
>
> a named unary call?


Oups?

It's just a bad choosen example; I should not have used a reserved word as=
=20
string content (I realized it after having sent my post)

Its simply a regex which deletes the first occurance of the string "delete"=
in=20
$_ ;

it's the same as

$_=3D~s/delete//;

example:

bash-2.05b$ perl

use warnings; use strict;

my $a=3D"this is deletea string";
$a=3D~s{delete}{};
print $a,"\n";


# this prints:

this is a string




greetings joe

> [...]

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com