I think what you're looking for is a zero-width negative look-ahead assertion.
##
if ($var =~ /this is (?!test|best|chest)/) {print "does not contain
##
Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com
-Original Message-
From: Ig
Went through perlrequik and prelretut and faq and can't seem to find the
answer to this question. Or maybe I'm just not thinking this thing out
straight in the first place.
How can I perform a pattern match where I want to match a part but not a
subpart of a string.
For instance, given
$var = "
Here we go!
my($username,$pw,$mdriveshare,%mdriveinfo,$err);
$mdriveshare = "really\\long\\dfs\\path";
%mdriveinfo =
(
'RemoteName' => $mdriveshare,
'LocalName' => "M:",
);
OK - that works for me too. I was using $File::Find::dir instead -
$File::Find::name seems to be the difference.
Thanks.
Dave Kazatsky
Senior Middleware Administrator
W. (908) 575-6947
C. (973) 865-8106
"Morbus Iff"
<[EMAIL PROTECTED]To:
>What I need to do is look at a directory structure regardless of files.
This works for me:
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
find(\&dirscend, "C:\\");
sub dirscend {
return unless -d $File::Find::name;
print "$File::Find::name\n";
}
If you need
Maybe I'm missing something but this doesn't seem to be doing what I need.
It appears that the directories are listed multiple times (once for every
file in the directory) and a directory isn't listed at all if no files
exist.
What I need to do is look at a directory structure regardless of files
Hello Richard,
Please reply to the list... My suggestion didn't work, and knowing that
maybe someone else can go a step further. If you only reply to me others
might think my suggestion worked for you since they didn't see a reply from
you.
> Interesting thought, but I changed up the code and it
Hello Joseph,
> Everything else you said was spot on, Guay; but using { } creates an
> *anonymous* hash (a reference). So now you have a single element hash
> whose key is a hash ref and whose value is undef.
>
> Just use parentheses to make a hash, where keys alternate with their
> values ("=>"
Guay Jean-Sébastien wrote, on Wednesday, March 17, 2004 2:17 PM
: > my($share) = some\\share\\path;
: > my(%shareinfo) = { 'RemoteName' => $share };
:
: I believe your mistake is here. Do not use parentheses after my,
: except if
: you want to assign individual elements of a list to
>I am trying to setup a recursive read to capture every
>directory and sub-directory but seem to be hitting a wall.
Use File::Find.
--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASI
Hello Perlers,
Need to write a script that compares directory structures (not files -
directories only).
I am trying to setup a recursive read to capture every directory and
sub-directory but seem to be hitting a wall.
Does anybody have any information I can use as starting point?
This will run
Hello Richard,
> my($share) = some\\share\\path;
> my(%shareinfo) = { 'RemoteName' => $share };
I believe your mistake is here. Do not use parentheses after my, except if
you want to assign individual elements of a list to individual variables...
Using parentheses tells my to create a l
Unfortunately, you are calculating the memory correctly. The registry really does
contain that value. To work around this problem, try implementing a custom rounding
subroutine for the memory size like so:
##
use strict;
my $original_memory = 127;
my $rounded_memory = RoundMemory ($original
not calling names here, but for all list members, please please
configure your out of office autoreply when on vacation etc so that you
don't spam people posting to the list. I don't want to unsub you, but I
will if I get complaints.
regards, JeffG
__
Hello Guru’s,
Can anyone provide me a real world example of
NetResources::AddConnection? RTFM’ing isn’t helping me much
today.
Here’s a snippet of what I’ve been swearing at…
my($share) = "some\\share\\path";
my(%shareinfo) = { ‘RemoteName'
=> $share };
Win32::NetResource
Hi Chris,
You're looking for LWP:
http://search.cpan.org/~gaas/libwww-perl-5.76/lib/LWP.pm
basic code:
use strict;
use CGI;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->agent('LWP-Spider');
my $url = 'http://www.activestate.com'; # default url
## check if there is a url as an argumen
Chris wrote:
> Is there module for downloading html source from a website? I need to grep
> the from a few thousand sites. I've googled and looked in cpan but
> the there are sooo many modules that work with html/xml it's hard to find
> what I need.
LWP or LWP::Simple should handle it. check li
Is there module for downloading html source from a website? I need to grep
the from a few thousand sites. I've googled and looked in cpan but
the there are sooo many modules that work with html/xml it's hard to find
what I need.
Regards,
Chris
___
P
Without registry you could try :
use Win32::API
my %results;
my $dwMSLength;
my $GlobalMemoryStatus ||=
new Win32::API("kernel32", "GlobalMemoryStatus", ["P"], "V") or return;
my $MEMORYSTATUS = pack "L8",(0, 0, 0, 0, 0, 0, 0, 0);
$GlobalMemoryStatus->Call($MEMORYSTATUS);
($dwMSLength, @results
Hello,
I've copied and slightly modified the code below to determine
RAM on machines using registry keys from a posting I came across while
googling. What's interesting is the code correctly returns the
installed RAM about 75% of the time - the remaining 25% come back with a
reading of 17
Hello world!
Does anyone know how to position the Win32::FileOp SaveAsDialog window? At the moment
it always seems to come up in the top left corner of the screen.
Is it something to do with the -handle option, and am I doing that right if the main
window is called $mw?
I am invoking it like t
> -Original Message-
> From: Peter Guzis [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 16, 2004 10:33 AM
> To: Pesce, Nicholas (Novus Consulting Group);
> [EMAIL PROTECTED]
> Subject: RE: disable cdrom and floppy
>
>
> use strict;
> use Win32::API;
>
> my $drive_letter = 'Z:';
>
> my
Hi
I am trying to control my mobile from my WinXP machine. The
mobile is connected through USB which is mapped on COM 5. With
Hyperterminal everything looks good.
But when I try:
---
use Win32::SerialPort qw( :STAT 0.19 );
$ob = ne
Do a google for "Perl2EXE of PerlApp"
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
> -Original Message-
> From: Ken Cornetet [SMTP:[EMAIL PROTECTED]
> Sent: Wednesday, March 17, 200
You can run perl from another machine. Install Perl on one machine, and
create a share to c:\perl (assuming that's where you install it).
For example: install perl and any required modules on machine "foo".
Share c:\perl as "perl".
Then, on the client machine you can run \\foo\perl\bin\perl
UncPa
25 matches
Mail list logo