[Israel.pm] Fwd: [Telux] Next Meeting: "High-Level Programming Concepts Using Perl 6" on 22-March

Mikhael Goikhman migo at homemail.com
Sat Mar 14 15:33:03 PDT 2009


On 14 Mar 2009 23:52:00 +0200, Evgeny wrote:
> 
> Can I have a prototype specifically for regexps?

Numerical or string value or reference or blessed reference (object) are
all specified as "$" in function prototyping. Read "perldoc perlsub",
under Prototypes secion. But you may want to start from less a advanced
documentation.

> I don't see it in the docs, and what this means that when I want to
> pass a regexp to a function - I MUST use qr// and can't just use /.../
> when writing the regexp as a parameter.
> 
> Like
> 
> Given / ... /   -- does not work

You can't say it does not work. Works as expected. See my first message.

> - but -
> Given qr/ ... /   -- does work

This works too, just for a different case. Did not you run the example
from my first message?

/.../ evaluates regular expression, and qr/.../ operator returns
something between a regular string and an object. Read "perldoc perlop"
under Regexp Quote-Like Operators section.

I would suggest you to take some time with the perl interpreter and the
documentation before asking more questions. :)

Regards,
Mikhael.

-- 
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'



More information about the Perl mailing list