>
>I'm using:
>my ( $yyyy, $mm, $dd ) = split /(-|\/)/, $yyyymmdd;
>but it doesn't work.
>

Hello,

try split /\W/,$string pls.

$ perl -le '$str="2006/10/31";my ( $yyyy, $mm, $dd ) = split /\W/, $str;print 
join " ",$yyyy, $mm, $dd' 
2006 10 31

$ perl -le '$str="2006-10-31";my ( $yyyy, $mm, $dd ) = split /\W/, $str;print 
join " ",$yyyy, $mm, $dd' 
2006 10 31

--
Books below translated by me to Chinese.
Practical mod_perl: http://home.earthlink.net/~pangj/mod_perl/
Squid the Definitive Guide: http://home.earthlink.net/~pangj/squid/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to