Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Just another Perl shrine
 
PerlMonks  

Re: using split on a string

by jorg (Friar)
on May 14, 2001 at 12:33 UTC ( [id://80189]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to using split on a string

You could forget all this regex stuff and use a standard Perl module instead :
use File::Basename; use Data::Dumper; my $path='C:\Documents and Settings\Administrator\Desktop\china.txt'; my @fileinfo=fileparse($path, '\..*'); print Dumper(@fileinfo);
will give you
$VAR1 = 'china';
$VAR2 = 'C:\\Documents and Settings\\Administrator\\Desktop\\';
$VAR3 = '.txt';
The fileparse() function takes a path as first argument and a pattern describing the extension as second arg

Jorg

"Do or do not, there is no try" -- Yoda

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://80189]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.