ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pdk
pdk
RE: Split Function With Expression
by Nikhil Bharucha other posts by this author
Feb 18 2005 7:45AM messages near this date
RE: Runtime Errors in /PerlApp/utf8_heavy.pl | Split Function With Expression
Aaah.  I am creating an OO Perl Module that I will instantiate and the
method (sub) which will have the split function could have $foo change
--  kind of the purpose... I read that too about $foo not changing but
it didn't register, Thanks.  

I am building a generic Ini file loader (to a hash which I return) and I
wanted to make it flexible to work with a delimiter passed by the method
caller.  I guess I have to limit the choice.  This is not a problem for
my use now but I was thinking about reuse in the future.


-----Original Message-----
From: $Bill Luebkert [mailto:dbecoll@[...].net] 
Sent: Friday, February 18, 2005 10:11 AM
To: Bharucha, Nikhil
Cc: pdk@[...].com
Subject: Re: Split Function With Expression

Bharucha, Nikhil wrote:

>  Hi,
>  
>   
>  
>  I finally have a need NOT to hardcode a pattern in a split function. 
>  However, it doesn't seem to be working:
>  
>   
>  
>  From CPAN "The pattern |/PATTERN/| may be replaced with an expression
to
>  specify patterns that vary at runtime. (To do runtime compilation only
>  once, use |/$variable/o|.)"
>  
>  Therefore this should work (right?):

I don't know - did it ?  Don't use /o unless you're sure $foo won't
change.

>  split (/$foo/o, $bar)

Don't ask questions without trying them first - then if it fails provide
the smallest test snippet you can that duplicates the error for you.

-- 
  ,-/-  __      _  _         $Bill Luebkert
Mailto:dbecoll@[...].net
 (_/   /  )    // //       DBE Collectibles    Mailto:dbe@[...].com
  / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


_______________________________________________
PDK mailing list
PDK@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved