Thanks guys,
that helped alot!!!
what about doing something like this:
if ($slurp =~ /defaultusername=(.+)/i) {
$usr = $1;
}
else {
print no defualtusername entry!! for $file;
}
if ($slurp =~ /defaultpassword=(.+)/i) {
$pass = $1;
}
else {
print No default password entry;
}
as part of a
Nex6 wrote:
Thanks guys,
that helped alot!!!
what about doing something like this:
if ($slurp =~ /defaultusername=(.+)/i) {
(.+) should probably be (.+?) to limit the match to the shortest
path unless you know there are no more s after it.
The RE will try for the longest match without
$Bill Luebkert [EMAIL PROTECTED] wrote:
Nex6 wrote:
if ($slurp =~ /defaultusername=(.+)/i) {
(.+) should probably be (.+?) to limit the match to the
shortest path unless you know there are no more s after it.
In this case it makes no difference, but in general a negated
character class
[EMAIL PROTECTED] wrote:
I am trying to Compare 2 strings for an if statement in an admin
script. $slurp is an entire file, and $file is a name.
what i would like to do is compare the 2, basicly saying if this =
that do this otherwise do this. i have the if statement and stuff
right i just
Try:
if ($file eq $usr)
since your comparing strings.
FYI, the single = is an assignment, -vs- ==
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Nex6
Sent: Wednesday, June 30, 2004 7:00 AM
To: perl-win32-users
Subject: comparing srtings
I am