Re: accessing ACCESS database

2002-11-13 Thread Douglas Gardiner
- 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

Subject: RE: file editting

2002-11-13 Thread Alfred Vahau
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 -

Re: query string into hash?

2002-11-13 Thread Ovid
--- 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

RE: query string into hash?

2002-11-13 Thread Toby Stuart
> 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

Re: query string into hash?

2002-11-13 Thread Wiggins d'Anconia
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

query string into hash?

2002-11-13 Thread Matt Simonsen
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

RE: accessing ACCESS database

2002-11-13 Thread Toby Stuart
> 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");

RE: accessing ACCESS database

2002-11-13 Thread Beau E. Cox
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);

Sending Mail

2002-11-13 Thread Jessee Parker
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

accessing ACCESS database

2002-11-13 Thread Angel Iliev Kafazov
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

Re: code ref and objects

2002-11-13 Thread Jason Tiller
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

Re: code ref and objects

2002-11-13 Thread Wiggins d'Anconia
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

RE: uptime

2002-11-13 Thread Timothy Johnson
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 "

Re: md5 encryption.

2002-11-13 Thread dan
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.

uptime

2002-11-13 Thread dan
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

code ref and objects

2002-11-13 Thread todd shifflett
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

File::Find ?

2002-11-13 Thread Steve Main
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.

Re: md5 encryption.

2002-11-13 Thread Felix Geerinckx
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

RE: fork?

2002-11-13 Thread Daryl J. Hoyt
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

RE: md5 encryption.

2002-11-13 Thread Timothy Johnson
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

fork?

2002-11-13 Thread chad kellerman
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

RE: [OT]: URGENT virus warning - Virus from msg: [Fireworks] OT: (Kind of) Font used in MX panels?

2002-11-13 Thread Perl
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:

RE: date

2002-11-13 Thread Aman Thind
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

Re: date

2002-11-13 Thread [EMAIL PROTECTED]
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]

date

2002-11-13 Thread Olympio Raymond
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]

RE: comparing arrays

2002-11-13 Thread wiggins
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

DBD::Sybase Question

2002-11-13 Thread gkhgkh
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.

comparing arrays

2002-11-13 Thread Diego Riano
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

RE: file editting

2002-11-13 Thread Aman Thind
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

file editting

2002-11-13 Thread Thomas Browner
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

RE: Sending mail under Windows 95/2000

2002-11-13 Thread Kipp, James
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

RE: map EXPR, LIST

2002-11-13 Thread Kipp, James
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

RE: Sending mail under Windows 95/2000

2002-11-13 Thread Jenda Krynicky
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

RE: use of my: why?

2002-11-13 Thread Beau E. Cox
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

use of my: why?

2002-11-13 Thread Duarte Cordeiro
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

Re: string can not be printed

2002-11-13 Thread John W. Krahn
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

Re: match only a-z or 0-9

2002-11-13 Thread John W. Krahn
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

RE: Sending mail under Windows 95/2000

2002-11-13 Thread Aman Thind
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

Re: string can not be printed

2002-11-13 Thread Ramprasad A Padmanabhan
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

Re: Newbie - Help with writing a memory leak script for an application...

2002-11-13 Thread Ramprasad A Padmanabhan
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

Re: Sending mail under Windows 95/2000

2002-11-13 Thread Tin-Shan Chau
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

RE: match only a-z or 0-9

2002-11-13 Thread Timothy Johnson
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

RE: match only a-z or 0-9

2002-11-13 Thread Timothy Johnson
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