try this:
chdir $indir or die "chdir $indir: $!";
print "reading $indir, please wait...\n";
# alle files ins array einlesen
@files = readdir(IDIR) or die "Error: Uable to read current dir:$!\n";
closedir(IDIR);
# das A
Hello everyone,
I'm fairly new to perl and recently signed up. I need help, below is my
script which is working but i really need to change my code, as I don't want
to use -M (match operator) and glob funtion in my code below.
Could you guys please correct my code below so I can use 'OPEND
In a message dated 2/16/2006 2:15:44 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> How about a slight variation :> > foreach ('123',
'123.', '123.txt', '123.some.txt', '123.some.text.txt')
{>
/^(?:(.*)\.[^.]+|(.*)\.|([^.]+))$/;> print $1 ||
$2 || $3, "\n";> }
/^ (.+?)
Mark Knoop wrote:
> Howard wrote:
>
>>my ($basename) = $_ =~ / ^(.*)\.[^.]+$/;
>>
>
>
> I presume the space ^ there is an error. Even so this does not work on
> 123
>
> $bill wrote:
>
>
>>I'd probably do it the easy way and just remove the ext:
>>
>>(my $file = $_) =~ s/\.[^.]*$//;
>>p
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Thursday, February 16, 2006 2:08 PM
Subject: Regular expression ;-)
Hello,
a simple regular expression is needed to eliminate the file extension:
$_="123";
/(XX)YY/;
print "$1\n" ; # result: "123";
$_="123.txt";
/(XX)YY/;
pri
Mark Knoop wrote:
>
> I would do it this way too... but I have got a bit sucked in to
> trying to do it using the model that was initially suggested which
> makes a neat little puzzle. I am stumped though! Can anyone find a
> way using the
>
> > $_="123";
> > /(XX)YY/;
> > print "$1\n" ; # resul
This also works…
my $a="123";
my @array = split /\./, $a;
pop @array if scalar (@array) >1;
print join(".", @array);
Howard A. Bullock
Computer Security
Tyco Electronics
717-810-3584
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 16,
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Mark Knoop
> Sent: Thursday, February 16, 2006 09:11
> To: ActivePerl@listserv.ActiveState.com
> Subject: RE: Regular expression ;-)
>
> Howard wrote:
> >
> > my ($basename) = $_ =~ / ^(.*)\.[^.]+$
Walter-
Some people (more common with those who are used to linux) will have
multiple . in the name, sometimes even using it as a way to
differentiate. i have seen old. placed before, or after.. so this
could become very complicated very fast.
I suggest getting a book on perl's reg exp shorts,
In a message dated 2/16/2006 10:01:03 A.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> a simple regular _expression_ is needed to eliminate the file extension:
> > $_="123"; > /(XX)YY/; > print "$1\n" ; # result:
"123"; > > $_="123.txt"; > /(XX)YY/; > print "$1\n"
; # result: "123"
In a message dated 2/16/2006 8:38:41 A.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> a simple regular _expression_ is needed to eliminate the file extension:
> > $_="123"; > /(XX)YY/; > print "$1\n" ; # result:
"123"; > > $_="123.txt"; > /(XX)YY/; > print "$1\n"
; # result: "123"
Howard wrote:
>
> my ($basename) = $_ =~ / ^(.*)\.[^.]+$/;
>
I presume the space ^ there is an error. Even so this does not work on
123
$bill wrote:
> I'd probably do it the easy way and just remove the ext:
>
> (my $file = $_) =~ s/\.[^.]*$//;
> print "$file\n";
>
I
[EMAIL PROTECTED] wrote:
>
> Hello,
>
> a simple regular expression is needed to eliminate the file extension:
>
> $_="123";
> /(XX)YY/;
> print "$1\n" ; # result: "123";
>
> $_="123.txt";
> /(XX)YY/;
> print "$1\n" ; # result: "123"
>
> $_="123.txt.txt";
> /(XX)YY/;
> print "$1\n" ; # result
s/\..{3}$//; # UNTESTED
Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503
[EMAIL PROTECTED]
www.nisc.coop
___
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL P
a simple regular expression is needed to eliminate the file extension:
$_="123";
/(XX)YY/;
print "$1\n" ; # result: "123";
$_="123.txt";
/(XX)YY/;
print "$1\n" ; # result: "123"
$_="123.txt.txt";
/(XX)YY/;
print "$1\n" ; # result: "123.txt";
Any suggestions for /(XX)YY/ ? Thanks.
Hello,
a simple regular _expression_ is needed
to eliminate the file extension:
$_="123";
/(XX)YY/;
print "$1\n" ; # result: "123";
$_="123.txt";
/(XX)YY/;
print "$1\n" ; # result: "123"
$_="123.txt.txt";
/(XX)YY/;
print "$1\n" ; # result: "123.txt";
Any suggestions for /(XX)YY/ ? Thanks.
Ki
Howdy all,
I'm using PerlTray for the first time and I've got everything working
fine except for one thing. My application displays output (), is
there a way to raise the DOS window by click an option on the PerlTray
menu? I didn't see anything about this in the documentation.
SkyBlueshoes
_
17 matches
Mail list logo