- Original Message -
From: "Beau E. Cox" <[EMAIL PROTECTED]>
To: "Angel Iliev Kafazov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 6:55 PM
Subject: RE: accessing ACCESS database
> Hi -
>
> I have never heard of the "Sql" method in DBI. Something like this
The equivalent one-liner for Aman's suggestion is:
perl -p -i -e's/(?:!|SUB-TOTAL)//' yourfile.txt
The above will seek out ! or SUB-TOTAL, replace them and write the
results to the current file i.e overwirte the file.
If you want to back up the current file, use the one-liner as follows:
perl -
--- Matt Simonsen <[EMAIL PROTECTED]> wrote:
> I need to get all the words in a query (q=___) out of a (URL, I think)
> encoded string.
>
> Example line and my current plan:
>
> $queryString =
> 'pp=20&q=Finance/Banking/Insurance&qField=All&qMatch=any&qSort=smart&view=1'
>
> my %querys = $query
> I need to get all the words in a query (q=___) out of a (URL, I think)
> encoded string.
>
> Example line and my current plan:
>
> $queryString =
> 'pp=20&q=Finance/Banking/Insurance&qField=All&qMatch=any&qSort
> =smart&view=1'
>
> my %querys = $queryString =~ /(\S+)=(\S+)&?/g ;
>
> #Here I
perldoc CGI
Or look at the code for that module...
http://danconia.org
Matt Simonsen wrote:
I need to get all the words in a query (q=___) out of a (URL, I think)
encoded string.
Example line and my current plan:
$queryString =
'pp=20&q=Finance/Banking/Insurance&qField=All&qMatch=any&qSort=s
I need to get all the words in a query (q=___) out of a (URL, I think)
encoded string.
Example line and my current plan:
$queryString =
'pp=20&q=Finance/Banking/Insurance&qField=All&qMatch=any&qSort=smart&view=1'
my %querys = $queryString =~ /(\S+)=(\S+)&?/g ;
#Here I could use a tip on how to
> Hi,
>
> I am trying to write a script that copies an information from
> ACCESS but
> it gives me the following error:
>
> Can't call method "Sql" on an undefined value at
> franowner.pl.txt line 4.
>
> Here's the script:
>
>
> use Win32::ODBC;
> $DSN="db1";
> $db = new Win32::ODBC("db1");
Hi -
I have never heard of the "Sql" method in DBI. Something like this works:
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect("DBI:ODBC:cpan")
|| die "could not connect to ODBC:MyDatabase:\n$DBI::errstr\n";
my $stmt = "select * from modules;";
my $sth = $dbh->prepare($stmt);
I've tried a few different methods of trying to send out e-mails for the
company I work for but I've run into a number of obstacles. Each way I've
tried, I've noticed that the script hits these periods of inactivity which I
don't exactly know is the cause. I've used 3 different modules and I ev
Hi,
I am trying to write a script that copies an information from ACCESS but
it gives me the following error:
Can't call method "Sql" on an undefined value at franowner.pl.txt line 4.
Here's the script:
use Win32::ODBC;
$DSN="db1";
$db = new Win32::ODBC("db1");
$db->Sql("SELECT owner_first_na
Hi, Todd (and Wiggins!), :)
On Wed, 13 Nov 2002, todd shifflett wrote:
> I am trying to use a code reference from within a function to
> recursively call a given separate function...
> #--- LIKE THIS --vv
> sub hello {
> my $name = shift;
> return "Hello, $name!\n";
> }
>
> sub foo
This is a guess but I think you can't 'my' the fft variable and then use
it as a reference. Because it is looking for main:: which your my'd
variable will not be in that namespace, or any namespace for that
matter. If you are working under use strict trying our'ing it instead,
or just removin
Here's one way:
$delta = 264200;
$daysPassed = int($delta / 86400);
$deltaDays = $delta % 86400;
$hoursPassed = int($deltaDays / 3600);
$deltaHours = $deltaDays % 3600;
$minsPassed = int($deltaHours / 60);
$deltaMins = $deltaHours % 60;
$secsPassed = $delta;
$deltaSecs = $deltaMins % 60;
print "
look up Crypt::PasswdMD5 on CPAN. I use the same module, no problems.
dan
"Christopher Burger" <[EMAIL PROTECTED]> wrote in message
news:!~!UENERkVCMDkAAQACABgAQQZ01V1XZUy+ZLRflK79TcKA
[EMAIL PROTECTED]
Just a quick question. How can encrypt something with md5 encryption.
how may it be possible to say how long it was before a certain time?
say for instance i have the variable
$starttime = time();
then, later an uptime was called. the time of the uptime being
$timenow = time();
$runningtime = $runningtime - $timenow;
now i have the amount of time the program has been
I am trying to use a code reference from within a function to
recursively call a given separate function...
#--- LIKE THIS --vv
sub hello {
my $name = shift;
return "Hello, $name!\n";
}
sub foo {
my($f, @args) = @_;
return &$f(@args);
}
print foo(\&hello, "world");
#---^^
the above work
Hello list,
I am trying to find a way in Perl to select all files in a directory
but the most current.
In shell I can do `find . -name *.arc | sort | tail -1` to get
the most current file and then exclude it from processing.
I was hoping someone could point out a way to do it entirely
in Perl.
on wo, 13 nov 2002 18:23:15 GMT, Christopher Burger wrote:
> Just a quick question. How can encrypt something with md5 encryption.
> I have passwords in a mysql database that are md5 encrypted. I was
> wondering if I can use something like
>
> $password = md5($input{'password'};
>
> to get th
I think what you want is
#!/usr/bin/perl
use strict;
use warnings;
$SIG{CHLD} = sub {wait ()}; #wait to avoid zombies
my $pid = fork ();
die "cannot fork: $!" unless defined($pid);
if ($pid == 0) {
#do some perl stuff
}
elsif($pid < 0) {
#do some other perl stuff
exit(0);
}
wai
perldoc Digest::MD5
This is the module you want to use.
-Original Message-
From: Christopher Burger [mailto:chris@;burgerfamily.net]
Sent: Wednesday, November 13, 2002 10:23 AM
To: [EMAIL PROTECTED]
Subject: md5 encryption.
Just a quick question. How can encrypt something with md5 enc
Hey guys,
I maybe misunderstanding what a fork can do, so I thought I would
write in to verify. Because it doesn't appear to be doing what I want
(think it should).
I have a script that tars (unix) directories. I want the script to tar
directories [a-n] as it is tarrring up [a-n] I want it
My antivirus (NA2002) found a bugbear virus sent to this beginners list (or
my perllist email address - I'm not sure what to make of the headers).
Did anyone else get this email? (virus has been removed of course):
If it helps anyone, I've included the culprit email and the headers:
Hi Ray
$sec = (localtime())[0];
$min = (localtime())[1];
$hour = (localtime())[2];
print "Time => $hour : $min : $sec\n";
$day = (localtime())[3];
$month = (localtime())[4] + 1;
$year = (localtime())[5];
$year = $year + 1900;
print "Date => $month \\ $day \\ $year";
-aman.
-Original Message
my $loc_time = scalar(localtime);
Olympio Raymond wrote:
How can you write the date and our of the system with a perl command ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
How can you write the date and our of the system with a perl command ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
perldoc -f grep
Essentially you would need to open each file, read each line and grab the name somehow
(regex, split, etc.). Then store the name to an array for the file (consider hash of
arrays with key being the filename and the value the array of names for that file).
Then store the name to
I am relatively new and always trying new things and now I am trying to print
the output of a select statement to a file. However I am having issues, the
print statement just prints the IN file to the outfile and not the results of
the select statement. Inserts, deletes, updates etc work fine.
Hello folks
I want to ask for your help about the following thing:
I have several files, like this one:
Katrin 12334 lsksol 094059
Karen 29383 skdjsk 092831
Paul21928 lskdiw 029384
I want to compare all the files to know which names are in all of them.
could you give some hints
Hi Thomas
File editing is particularly easy in perl.
Herez some sample code to get you started :
--
@ARGV='C:\Documents and Settings\athind\Desktop\test\File2Edit.txt'; # path
to the file you
I there away to edit a file in perl? This is what is I am trying to do.
I have a file that I want to remove some content. This is an example of
a line:
! 6134.21 3200 SUB-TOTAL: M:\alvin
I want to remove the ! and SUB-TOTAL. I hope some one can tell me an
simple way of doing t
access may have access to the exchange server just like OUtlook does. I
think the problem is that you are behind a firewall. I myself can send
external email with outlook and using an ASP page, but CAN NOT do it with
any of the perl modules, like Net::SMTP
-Original Message-
From: Tin-Shan
I think somebody posted to swap the map and print statments.
-Original Message-
From: Deb [mailto:deb@;tickleme.llnl.gov]
Sent: Tuesday, November 12, 2002 4:13 PM
To: Kipp, James
Cc: Perl List
Subject: Re: map EXPR, LIST
Hmmm, that's a useful work-around.
I may use it, but I'm really
From: Aman Thind <[EMAIL PROTECTED]>
> Just use "shaw" instead of "shaw.ca" as in :
>
> $smtp = Net::SMTP->new('shaw')||die("my woes are never ending :(");
>
> You are supposed to use only the name of the mail server.
> shaw.ca is an invalid argument to Net::SMTP as you will fi
Hi -
'my' sets up a variable valid in the enclosing block only.
In your exmaple, func1 creates an array @array, plays with
it, and discards it when the function ends.
Aloha => Beau.
-Original Message-
From: Duarte Cordeiro [mailto:duarte.cordeiro@;neoris.com]
Sent: Wednesday, November 13
in this block:
sub func1{
my @array=(0,0,0);
func2();
print "it's not working" if ($array[1]==0);
}
Sub func2(){
return if($array[1]==1);
$array[1]=1 if($array[1]==0);
func2();
}
This doesn't do nothing :) but I came across this problem in a script
Ramprasad A Padmanabhan wrote:
>
> do this
>
> $header=~s/\r+//g;
>
> and then try parsing it
> Also
> You need not use /\nFrom:\s*(.*)/m
> You can use /^From:\s*(.*)$/m
> ( 'm' treats every new line a full string individually)
/m causes the ^ and $ anchors to match the beginning and end of a l
David Buddrige wrote:
>
> Alex Cheung Tin Ka wrote:
> >
> > Could anyone tell me how to make a regular expression for match a string only
>[a-z0-9] ?
>
> [a-z0-9]+ will match a sequence of characters containing one or more of
> the set [a-z0-9].
>
> If you want to match a line of characters tha
Hi
Just use "shaw" instead of "shaw.ca" as in :
$smtp = Net::SMTP->new('shaw')||die("my woes are never ending :(");
You are supposed to use only the name of the mail server.
shaw.ca is an invalid argument to Net::SMTP as you will find if you use :
print "$!"; after trying to connect to the serv
do this
$header=~s/\r+//g;
and then try parsing it
Also
You need not use /\nFrom:\s*(.*)/m
You can use /^From:\s*(.*)$/m ( 'm' treats every new line a full string
individually)
I think you are getting a carriage return.
Julien Motch wrote:
Hi ,
I am again experiencing problem with regular e
use tools like memprof for finding memory leaks
why bother writing your own
Alex Yuen wrote:
Hi,
I am still a newbie to Perl.
I am assigned to write a Perl program to monitor a memory leak on an
application running on a Sun system - Solaris. Now, I'm a Windows NT System
Administrator...so, I am
I did find out that the problem is with:
$smtp = Net::SMTP->new('shaw.ca');
by adding "or die...". However, I am able to send e-mail to myself using MS
Access. Any other idea what my problem might be?
Thanks.
- Original Message -
From: "Timothy Johnson" <[EMAIL PROTECTED]>
To: "'Kipp
Correction: That should be [a-z0-9]+. (note the plus)
-Original Message-
From: Timothy Johnson
To: 'Alex Cheung Tin Ka '; '[EMAIL PROTECTED] '
Sent: 11/13/02 12:01 AM
Subject: RE: match only a-z or 0-9
You've essentially already done it. [a-z0-9] is a character class that
includes a
You've essentially already done it. [a-z0-9] is a character class that
includes all characters within that range. So something like this would
work:
if($string =~ /^[a-z0-9]$/){
print "It's only letters and digits.\n";
}else{
print "There's something else in there.\n";
}
-Original Mes
43 matches
Mail list logo