Gossamer Forum
Home : General : Perl Programming :

Newbee Syntax Question

Quote Reply
Newbee Syntax Question
What is the proper use of '%' ?
Quote Reply
Re: [keystroke] Newbee Syntax Question In reply to
In what sense?
Quote Reply
Re: [Paul] Newbee Syntax Question In reply to
S%..... in regular expression

or

% Perl

I've seen it both ways and I can make a good guess as to what its for but I have not found an reference of the proper uses.
Quote Reply
Re: [keystroke] Newbee Syntax Question In reply to
No such thing that I know of in regex regarding your first example. I haven't see the second example either.

How about...

my %hash = ();
Quote Reply
Re: [Paul] Newbee Syntax Question In reply to
I'm working a bugzilla hack.

This is the snip I'm trying to figue out.



s%((mailto:)?([\w\.\-\+\=]+\@[\w\-]+(?:\.[\w\-]+)+)\b|
(\b((?:$protocol):[^ \t\n<>"]+[\w/])))%"##$count##"%exo)

Quote Reply
Re: [keystroke] Newbee Syntax Question In reply to
Oh right, that's just using % as the regex delimiter instead of the usual /

So the following are the same....


$string =~ s/a/b/;

$string =~ s%a%b%;
Quote Reply
Re: [Paul] Newbee Syntax Question In reply to
Cool, Thanks

Cool