James Edward Gray II wrote:
On Tuesday, September 2, 2003, at 01:52 PM, Dan Muey wrote:
if($mystr =~ m/^exactstr$/) { print 'Ye haw it matches!'; }
This isn't a pattern, this is an equality test. I would consider the
above a poor use of Regular Expressions. $mystr =~ /^exactstr$/ is
identi
You can get all the basic stuff on arrays in this url
http://perldoc.com/perl5.8.0/pod/perlintro.html
You can get more info from this url also
www.cs.cf.ac.uk/Dave/PERL/
FYI
perldoc.com contains all the information related to perl in web page format.
SV
On Mon, 1 Sep 2003, Antonio Jose wrote:
Hi all,
I am currently using Net::SSH::Perl module to login in my remote machine.
Below is my code:
==
#!/usr/bin/perl
use Net::SSH::Perl;
$user="jaws";
$pass="password";
$host="111.222.333.444";
my $ssh = Net::SSH::Perl->new($host,"'1,2'");
$ssh->login($user, $
Thanks for the info, James. Sounds like threading is still a ways over my
head, but forking sounds interesting.
I have a perl script that does simple find-replaces within all the files
passed to it (the key parts were written by very kind people on this list,
actually). Would it be advantageou
I run into this a lot. There is JavaScript in the page, and you need to
emulate that in your script.
Look at the source HTML for the page. It takes the password and look like
it Base 64 encodes the password, then sets a hidden form field named
"encoded_pw" to the value. It then clears the passw
Hi!
Im creating an script that checks for broken links. Im using this modules:
use WWW::Mechanize;
use HTTP::Cookies;
What Im trying to do?, I need to login in a website (cause to check broken
links I need to be loged).
I also checked the cookies once I've loged and they're created, however,
Dan Muey wrote:
>
> if($c =~ m/0$|2$|4$|6$|8$/){ $c = $c - 3; }
A verbose way of saying:
if($c =~ /[02468]$/){ $c -= 3 }
Or:
if(!($c % 2)){ $c -= 3 }
:-)
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Bob Showalter wrote:
Jenda Krynicky wrote:
From: "Bob Showalter" <[EMAIL PROTECTED]>
Vic wrote:
I wanna ask when running Apache 2.046 under Windows XP with
mod_cgi, how can I turn on the taint mode for the Perl
interpretor? (i guess the shebang line wont work since windows
nvr look at them anywa
Hello
Where can I see (web pages) examples of manipulating arrays, calculos
with elements of arrays or something like that?, I am writing a program
where I need to read, process, print to file, save arrays (vectors and
matriz) but I am beginner using Perl and it's difficult for me to do it.
T
> This is my first ever Perl script (!)
>
Good for you!
> The script is supposed to continously query google for hits
> on the "search google for this string" and store the returnde
> URLs to database. In the scipt below it should query 5 times
> (0-50 hits, 10 hits returned per query) howe
On Tuesday, September 2, 2003, at 02:19 PM, JOHN FISHER wrote:
I have been using the split command happily for awhile, spliting up
based on commas and tildes.
However, I had a problem with a new file and noticed my script had
created extra fields.
If you have a file like this:
"Washington, Geo
I have been using the split command happily for awhile, spliting up based on commas
and tildes.
However, I had a problem with a new file and noticed my script had created extra
fields.
If you have a file like this:
"Washington, George",909,"Abraham Lincoln",-100.00, "$10,500"
How can I appropri
On Tuesday, September 2, 2003, at 01:52 PM, Dan Muey wrote:
if($mystr =~ m/^exactstr$/) { print 'Ye haw it matches!'; }
This isn't a pattern, this is an equality test. I would consider the
above a poor use of Regular Expressions. $mystr =~ /^exactstr$/ is
identical to $mystr eq 'exactstr' exc
> How to test for exact string match?
>
> this doesn't work:
>
> $mystr == "exactstr"
You've already got the numeric use of == explained and eq but no body showed you the
regex that
Lets you anchor it and do case sensitivity etc...
if($mystr =~ m/^exactstr$/) { print 'Ye haw it matches!';
This is my first ever Perl script (!)
The script is supposed to continously query google for hits on the "search
google for this string" and store the returnde URLs to database. In the
scipt below it should query 5 times (0-50 hits, 10 hits returned per query)
however if i set the loop to run till
On Tue, 2003-09-02 at 14:21, rkl wrote:
> Thanks! You guys.gals are fast!
>
> Ok. Use eq instead of == for string compare but does single quote or qouble
> quote matter?
>
> thanks again,
> -rkl
rkl,
Single/Double quotes determine interpolation of variables contained
within the quotes... f
On Tuesday, September 2, 2003, at 01:21 PM, rkl wrote:
Thanks! You guys.gals are fast!
;)
Ok. Use eq instead of == for string compare but does single quote or
qouble quote matter?
Double quote interpolate variables and special characters inside on
them, so:
"\t$mystr" becomes " exactstr" minu
Thanks! You guys.gals are fast!
Ok. Use eq instead of == for string compare but does single quote or qouble
quote matter?
thanks again,
-rkl
rkl writes:
How to test for exact string match?
this doesn't work:
$mystr == "exactstr"
thanks
-rkl
--
To unsubscribe, e-mail: [EMAIL PROT
Use "eq" (as well as lt, gt, ne, ge, le, cmp) for string matching. The
operators "==" (as well as <, >, !=, >=, <=, <=>) for numeric matching.
Perl will convert the values based on the operator used.
So with "==", like you are using, Perl converts both arguments to numbers
before comparing.
So t
On Tuesday, September 2, 2003, at 01:12 PM, rkl wrote:
How to test for exact string match?
this doesn't work:
$mystr == "exactstr"
You're very close. == is for testing numbers, just change it to eq
which is for testing strings:
$mystr eq 'exactstr'
Hope that helps.
James
--
To unsubscribe,
rkl wrote:
> How to test for exact string match?
>
> this doesn't work:
>
> $mystr == "exactstr"
The double equal sign is numeric compare. If you want to use equal then eq
should replace the ==
Wags ;)
>
> thanks
> -rkl
**
Th
How to test for exact string match?
this doesn't work:
$mystr == "exactstr"
thanks
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Tue, 2003-09-02 at 12:54, perl wrote:
> Please help me parse this www.mydomain.com to just mydomain.com
>
> Below are some scenarios in which all I want is the last two values,
> mydomain.com :
>
> mydomain.com = mydomain.com
> www.yourdomain.com = yourdomain.com
> www.station.fire.org = fi
Something like this should work...
my $domain = 'www.station.fire.org';
if ($domain =~ /([^\.]+\.[^\.]+)$/) {
print "$1\n";
}
else {
print "Failed to find domain\n";
}
This is very lenient in the matching, so it should match all valid domain
names as well as a lot of invalid ones. If th
I am sure there are way better ways, in my case I am using the base load of
Perl. I have over a 1000 computers with this same load that I need to be
able to update and Win32::Console is loaded already. I wish I had TK loaded
but I don't, so I use what I have :-)
I just happened to be walking thro
Please help me parse this www.mydomain.com to just mydomain.com
Below are some scenarios in which all I want is the last two values,
mydomain.com :
mydomain.com = mydomain.com
www.yourdomain.com = yourdomain.com
www.station.fire.org = fire.org
results in just the base domain.
thanks
--
T
Funny you just caught me working on something similar, and I have modified
this code for my purposes. This should lead you in the right direction!
Snip
#!/usr/bin/perl
use Win32::Console;
$StdIn = new Win32::Console(STD_INPUT_HANDLE);
my $Password = "";
$StdIn->Mode(ENABLE_PROCESSED_
John Nestor wrote:
> A couple of days ago, I sent in some code with an error message:
>
> Can't find unicode character property definition via main->a or a.plFile
> 'unicode/Is/a.pl'; Line 0
>
> As it turns out, the code sample I included was not the cause of the
> problem, apparently. However,
Hello,
>From an Oracle utlfile data under unix, I generate an Excel-Worksheet with
the module Spreadsheet::WriteExcel.
How can I do the same, but for Access ?
Thank you.
Olivier
--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--
1. GMX Top
If you are on Windows with AS-Perl, you should use there version of ReadKey.
I might be wrong, but I think that module includes some C code. So unless
you have C++ and compiled Perl yourself, you want to use the AS version of
the module, which will be pre-compiled for you.
The AS module list for
> "Trent" == Trent Rigsbee <[EMAIL PROTECTED]> writes:
Trent> Hi! I've completed "Beginning Perl" by Simon Cozens. What do you
Trent> recommend as my next book? I'd like to tackle "Networking Programming
Trent> with Perl" by Lincoln Stein or "Win32 Perl Scripting" by Roth but I'm
Trent> not s
On Friday, August 29, 2003, at 01:32 AM, Bryan Harris wrote:
Neat! Is this how "threads" are spawned? or are forked processes
different
from threads?
If this is how threads are spawned, how do big commercial apps manage
to do
multiple things at once without completely duplicating the entire
On Sunday, August 31, 2003, at 10:00 PM, Trent Rigsbee wrote:
Hi! I've completed "Beginning Perl" by Simon Cozens. What do you
recommend as my next book? I'd like to tackle "Networking Programming
with Perl" by Lincoln Stein or "Win32 Perl Scripting" by Roth but I'm
not sure if I'm ready for
> try
>
> open (INFILE, " filename.txt.$!,stopped"; @array = ; close(INFILE);
> foreach my $rec (reverse(@array)) {
> chomp($rec);
> ($a,$b) = split(/\|/,$rec);
Just a litle tip, I think it's not a good idea to use
$a and $b variables since Perl uses those for sort() and whatever.
Try:
Win32::Process
I never used so far myself but can help for what you want.
http://search.cpan.org/author/GSAR/libwin32-0.191/Process/Process.pm
-Original Message-
From: Anthony J Segelhorst [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 1:50 PM
To: [EMAIL PROTECTED]
Subje
I am on win2k, active perl 5.6.1 system.
I downloaded the ReadKey module, (all the packet of Term-Readkey-2-21)
I gave perl MakeFile.pl and i recieved writing MakeFile
then i set make, and it says that there is not target file
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
I have been working on a Perl script that will kill a Windows Process if
it has been running for an x amount of time. This script will run on a
Windows Platform.
pslist is a tool that can be retrieved from
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
the output from pslist EXCEL l
Hi,
I have already using DBI module, I just wanted to explain with an example.
Let think that I want to be root user and issue some command in that case I
also need
bidirectional pipes.
su - root
Password
execute some commands here .
Mehmet
ZSDC,
I love this stuff! You explain these concepts very clearly, have you ever
considered teaching? I'm happy to keep asking questions as long as you're
willing to answer them. =)
> Servers often work this way. There's a process listening on a port but
> when someone connects, it doesn't se
[EMAIL PROTECTED] wrote:
Hello,
I tried it to use with sqplus username/passwd
after this I like to send some sql commands and get their results but
at some point system blocks and I don't get anything
$ph = open2 (\*Reader , \*Writer, "sqlplus xxx/yyy");
print Writer , "desc user_tables;\n";
wh
Hello,
I tried it to use with sqplus username/passwd
after this I like to send some sql commands and get their results but
at some point system blocks and I don't get anything
$ph = open2 (\*Reader , \*Writer, "sqlplus xxx/yyy");
print Writer , "desc user_tables;\n";
while ()
{
print ;
}
$in=12345678.90;
$out=&big_money($in);
sub big_money {
$number = sprintf " %.2f", shift @_;
1 while $number =~ s/^(-?\d+) (\d\d\d) /$1, $2/; $number=~
s/^(-?)/$1\$/; $number;
}
-Original Message-
From: Ronen Kfir [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003
Hi,
This code is taken from "learning Perl\ Schwartz & Phoenix.
sub big_money {
$number = sprintf " %.2f", shift @_;
1 while $number =~ s/^(-?\d+) (\d\d\d) /$1, $2/;
$number=~ s/^(-?)/$1\$;
$number;
}
In the book they write the no. 12345678.90 as the no. of example. What I
Thanks for the link. It will be useful. But I still have a question.
What do I do with it since there is no explanation and I am totally new
to this. Please provide a little more detail.
Thanks
[EMAIL PROTECTED] wrote:
see Apache::LogDBI and a discussion of it at:
http://perl.apache.org/docs/t
Hi,
thogh might seem to be a bit outmoded at the time I suggest to use
TeX.
It is a highly portable and rather easy-to-use system, and can beat
Docbook/XML in many cases. Desing your invoice or whatever macro file,
and generate the TeX input file via perl.
IMHO the old technologies may give you
[EMAIL PROTECTED] wrote:
Hi all,
I wonder how can I open pipe to STDIN and STDOUT of a process ?
perldoc IPC::Open2
If you need a handle to STDERR
perldoc IPC::Open3
Tnx.
Mehmet
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi all,
I wonder how can I open pipe to STDIN and STDOUT of a process ?
Tnx.
Mehmet
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> -Original Message-
> From: Mark Weisman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 02, 2003 4:53 PM
> To: [EMAIL PROTECTED]
> Subject: Reverse Order?
>
>
> I read a text file into HTML for viewing through a webpage, fairly
> straight forward.
>
> Open (INFILE, " filename.tx
try
open (INFILE, ";
close(INFILE);
foreach my $rec (reverse(@array)) {
chomp($rec);
($a,$b) = split(/\|/,$rec);
print "$a - $b\n";
};
-Original Message-
From: Mark Weisman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 8:53 AM
To: [EMAIL PROTECTED]
S
49 matches
Mail list logo