in reply to Extract string from rear of string
#/usr/bin/perl -w use File::Basename; use strict; my @files = <*>; foreach my $file (@files) { my ($name,$dir,$type) = fileparse($file,'\..*'); print sprintf("file= %30s", $name), sprintf(" ext= %10s", $type), +"\n"; }
or something similar.my($filename,$ext) = split(/\./,$file);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extract string from rear of string
by Juerd (Abbot) on Dec 29, 2001 at 03:54 UTC |