Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: using split on a string

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2021-09-22 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?