Re: Pass a wild card argument in Win32



On Sat, Jun 28, 2008 at 4:49 AM, Mike <Netadptr0719@xxxxxxxxx> wrote:


I am able to pass regular arguments to perl but is it possible to get
the * operator to work like it does in Linux?

No. Perl treats * as different as linux shell.

Like typing in *.cpp to
pass perl all .cpp files.

Try this instead:

use strict;

my $pattern = qr/\.cpp$/;
myfind($pattern);

sub myfind {
my $x = shift;
opendir DIR,"." or die $!;
while(my $f = readdir DIR) {
print $f,"\n" if $f=~/$x/;
}
close DIR;
}

--
Regards,
Jeff. - Peng.Kyo@xxxxxxxxx
.



Relevant Pages

  • UTF-8-codierte Umlaute via print und warn ausgeben
    ... Unter Windows/Cygwin im Cygwin-Terminal mit Cygwins Perl: ... Im UTF-8-Xterm funktioniert die Umlautausgabe mit print und warn, ... der zweite foo.pl-Aufruf unter Linux (und im ... Cygwin Perl (im xterm und im "gewoehnlichen" Cygwin-Terminal) und auch ...
    (de.comp.lang.perl.misc)
  • Re: LD_LIBRARY_PATH on x86_64 linux
    ... I imagine you also have to take in to account whether you are using 64bit OS vs 32 bit perl, etc. etc. I've always dealt with this issue on my Sun boxes and resorted to using a wrapper script. ... My environment generally needs to be different for launching other oracle applications, so this way I don't break other things. ... Subject: LD_LIBRARY_PATH on x86_64 linux ... on other Linux platforms, too. ...
    (perl.dbi.users)
  • Re: Demand of PF CLI
    ... >> using the PF APIs directly, or providing such access in perl, python, ... >> style approach was taken to embrace other firewall solutions. ... > you mean this module could work for Linux iptables too. ... There is Linux's iptables, ipf on NetBSD and Solaris, ...
    (comp.unix.bsd.openbsd.misc)
  • Re: Should fresh graduates be good at platform specific libraries?
    ... curious enough about linux to setup a linux box. ... unix-like shell environment and have not discovered perl. ... kind of stuff that says you will not be passionate about this career. ... real regular expressions in an Automata Theory course. ...
    (comp.programming)
  • Re: Need help installing WWW-Search-Ebay-2.193 Module...
    ... One of the O'Reilly Books has a script that calls this ... >>languages (which are far easier to program in under Linux than under ... > perl Makefile.PL ... >>ActivePerl for Linux under Cygwin ...
    (comp.lang.perl.misc)