invoking sub/methods shortcut

2003-10-01 Thread perl
Can I do something like this? from $sth = getVUser($dbh, $u, $d); return $sth->rows(); to return (getVUser($dbh,$u,$d))->rows(); a move from java->perl ;) thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [Thanks]: Re: Objects, threads and so on

2003-10-01 Thread R. Joseph Newton
david wrote: > Fernando wants to send the following thanks to all people who helped him on > this topic and some explanation of what he really wants to do. He somehow > sent it to myself only. > > #- forward message started -# > > Hello all, > OK, then. One subject at a t

easiest `cat` in perl

2003-10-01 Thread Bryan Harris
I'm just barely starting into the world of CGI. I think this is going to be the best thing I ever did. What I think I want to do is have a library of HTML snippets (like a generic header and footer), and then use perl to output them in order along with any custom content. What I'm interested i

RE: problem with date routine

2003-10-01 Thread Tim Johnson
Try something like this: my($todayMday,$todayMon,$todayYear) = (localtime)[3..5]; my($yesterMday,$yesterMon,$yesterYear) = (localtime(time - 86400))[3..5]; $todayMon++; $todayYear += 1900; $yesterMon++; $yesterYear += 1900; -Original Message- From: perlwannabe [mailto:[EMAIL PROT

problem with date routine

2003-10-01 Thread perlwannabe
I have a relatively simple script that needs to get two separate dates, today's date, and yesterday's date. The dates are in mmddyy format. Everything works great on days 2 - 31 of the month, but on the first of the month yesterday's date is not correct. For example, on October 1, 2003 the varia

Re: Perl Beginners Portals

2003-10-01 Thread R. Joseph Newton
Todd Wade wrote: > I'm willing to pester the site owners to let you do the site. But it will > probably take more than just you and I. The lack of responses to your OP > might indicate the amount of help the rest of the group is willing to > contribute. I think you may be misinterpreting the sile

RE: Is there a way to print out the contents of a variable in hum an readable format?

2003-10-01 Thread Tim Johnson
Definitely check out Data::Dumper; -Original Message- From: Dan Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 9:55 PM To: Tim Johnson Cc: [EMAIL PROTECTED] Subject: RE: Is there a way to print out the contents of a variable in hum an readable format? > Could you

RE: Is there a way to print out the contents of a variable in hum an readable format?

2003-10-01 Thread Dan Anderson
> Could you give an example of what you mean? I don't use PHP, but I can > think of about three functions that MIGHT be what you're looking for. Well for instance print_r does the following: @array = (1,2,3,4); print_r(@array); produces: ARRAY ( [0] = 1, [1] = 2, [2] = 3, [3] = 4 )

Re: Is there a way to print out the contents of a variable in human readable format?

2003-10-01 Thread simran
not sure what you mean... but: % perldoc Data::Dumper might be handy... On Thu, 2003-10-02 at 14:46, Dan Anderson wrote: > Is it possible to print out the contents of a variable in a human > readable format? For instance like PHP's print_r() function? > > Thanks in advance, > > Dan -- To

RE: Is there a way to print out the contents of a variable in hum an readable format?

2003-10-01 Thread Tim Johnson
Could you give an example of what you mean? I don't use PHP, but I can think of about three functions that MIGHT be what you're looking for. -Original Message- From: Dan Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 9:47 PM To: [EMAIL PROTECTED] Subject: Is there

Is there a way to print out the contents of a variable in human readable format?

2003-10-01 Thread Dan Anderson
Is it possible to print out the contents of a variable in a human readable format? For instance like PHP's print_r() function? Thanks in advance, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Look At This Package

2003-10-01 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Can someone make this work like I want? I'm trying to create a package > USER and reference/change it. The only thing I'm able to do is to call the > sub prtAll. I just want a structure that I can pass around in perl. > > test.pl > --- > use USER; > > #this does NOT

Re: how to reuse sub

2003-10-01 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > How can I reuse a subroutine? > > My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5. > I've tried to put the sub in a separate file and call it from another as > below. Please modify the snipet below to make it work. > > mycommon.pl > --- > #

Re: Why is Perl's Object System Set Up This Way?

2003-10-01 Thread James Edward Gray II
On Wednesday, October 1, 2003, at 10:06 PM, Dan Anderson wrote: I just figured out Perl's object / modules system. And after racking my brain for hours trying to figure out the how, I was hoping somebody could explain the why -- why exactly was Perl's object system set up the way it is? [snip

Why is Perl's Object System Set Up This Way?

2003-10-01 Thread Dan Anderson
I just figured out Perl's object / modules system. And after racking my brain for hours trying to figure out the how, I was hoping somebody could explain the why -- why exactly was Perl's object system set up the way it is? For instance, C++ is (unbelievably) clear: class foo { public: // pu

Re: Look At This Package

2003-10-01 Thread perl
Ok - I got it finally. I've used the use strict; in my progs. You're right. it helps to identify loosely hanging vars that'll get ya. Thanks, I'm getting a hang of it slowly, frustratingly but surely. I'm just touching onto this perl class object thing but it seems pretty interesting. I'm trying

Apache Log files

2003-10-01 Thread Mike Blezien
We are working on perl scripts to read data from the various Apache access_log formats, IE. common, combined,..etc., for custom web stats. Is there any Perl modules available that are designed to do this without trying to "re-invent the wheel" ?? thx's MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: vaiables global and local

2003-10-01 Thread David Wall
--On Tuesday, September 30, 2003 1:43 PM -0700 david <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: How do you declare a var global versus local? It seems variables a local and not static as in shell. [big snip] all this is explained at: perldoc -q scope perldoc -q "difference between dy

Re: Getting started in Perl for OSX

2003-10-01 Thread James Edward Gray II
On Wednesday, October 1, 2003, at 04:34 PM, McMahon, Chris wrote: But Perl doesn't come with OSX by default. You may or may not have an install CD called "Developer Tools" or some such, and Perl is on that. At the risk of sounding like a broken record, this still isn't true. Perl has shipped

Re: owner's name of a file

2003-10-01 Thread Josimar Nunes de Oliveira
Hi Michel, Thanks for your help, but the code will run on windows2000server and the mapped drive points to a folder on novell server. The "getpwuid" is unimplemented in windows2000server perl. I would like to take the file´s ownership related to novell server NDS users. Thanks again, Josimar -

RE: Getting started in Perl for OSX

2003-10-01 Thread McMahon, Chris
Hi Deborah... From a terminal prompt, do "which perl". If you get back something like "/usr/bin/perl", you're in business. But Perl doesn't come with OSX by default. You may or may not have an install CD called "Developer Tools" or some such, and Perl is on that. If you don't

www::Mechanize through proxy

2003-10-01 Thread Raghupathy
Hi All, Here I am again asking for help from the wonderful folks ... I am running perl 5.8.0 on windows NT machine. I am trying to run a simple script using WWW::Mechanize through a proxy server. I have setup the HTTP_proxy, HTTP_proxy_pass and HTTP_proxy_user environment variables

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Wiggins d'Anconia
On Wed, 1 Oct 2003 22:43:39 +0200, Paul Johnson <[EMAIL PROTECTED]> wrote: > On Wed, Oct 01, 2003 at 03:54:25PM -0400, Paul Kraus wrote: > > > I need to do recursive deletes. But according to perldoc I should not > > use unlink. I should use rmdir

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Paul Johnson
On Wed, Oct 01, 2003 at 03:54:25PM -0400, Paul Kraus wrote: > I need to do recursive deletes. But according to perldoc I should not > use unlink. I should use rmdir. However rmdir does not work unless the > directory is empty Should I just system rm -r Why not? If that does what you wan

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread David T-G
Paul -- ...and then Paul Kraus said... % % I need to do recursive deletes. But according to perldoc I should not % use unlink. I should use rmdir. However rmdir does not work unless the Yep. The short form: A directory contains pointers to all of the files "in" it. If you unlink the directory

RE: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Wiggins d'Anconia
On Wed, 1 Oct 2003 15:54:25 -0400, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > I need to do recursive deletes. But according to perldoc I should not > use unlink. I should use rmdir. However rmdir does not work unless the > directory is empty Sho

Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Paul Kraus
I need to do recursive deletes. But according to perldoc I should not use unlink. I should use rmdir. However rmdir does not work unless the directory is empty Should I just system rm -r >From perldoc unlink LIST

RE: Should loops return a value?

2003-10-01 Thread Ville Jungman
Hi all reading this conversation. I wrote a perl script that returns values from 'foreach', 'if-elsif-else' and 'while' -constructs. You can put perl code with value-returning loops to the beginning of the script. The script translates and evaluates it when it's ran. There's an odd example cod

Re: extending modules

2003-10-01 Thread Jeff 'japhy' Pinyan
On Oct 1, Kevin Pfeiffer said: >> package Unix::AliasFile::Extended; >> use base 'Unix::AliasFile'; >> >> sub changed_method { ... } >> sub new_method { ... } >> >This worked better and was easier (once I remembered to update 'ISA@') than >I expected! I ended up adding two or three new met

RE: script+file format

2003-10-01 Thread TN
There are a lot of different file formats and many of them are the same on all platforms. For example, as fas as I know the format for JPEG files is platform independent. What sorts of files are you interested in? And on what platform(s) will you want to run the script? On unix systems, for e

Re: how to know if a module is "stock" (i.e. comes with Perl install)

2003-10-01 Thread Randal L. Schwartz
> "Kevin" == Kevin Pfeiffer <[EMAIL PROTECTED]> writes: Kevin> I have a feeling this a FAQ... Kevin> I've CPANed so many modules I no longer know which came with Perl and which Kevin> not. How can I determine this? (1) see if it's listed in "perldoc perlmodlib". If it is, it's core. (2) use

Re: Fw: Net::SCP::Expect

2003-10-01 Thread Jose Malacara
I have tried IP address as well and get the same error message. I have considered alternate ways of doing this, but now I'm bent on figuring out why this isn't working for me! Thanks for the input. Jose - Original Message - From: "TN" <[EMAIL PROTECTED]> To: "'Jose Malacara'" <[EMAIL PRO

RE: Fw: Net::SCP::Expect

2003-10-01 Thread TN
Perhaps you should automate ssh logins by using a key that requires no passphrase, in other words so you can just "ssh [EMAIL PROTECTED]" and you're in with no interaction required. Then you don't need expect for that. Also, have you tried using the hostname IP address, just to see what happens?

script+file format

2003-10-01 Thread Mohamed HOUSSNI
Hello, I am looking for a perl script to detect and display a format of file (i.e. unix, dos or mac). I will be very grateful to you to help doing this. Best regards, -- Dr. Mohamed Houssni -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Fw: Net::SCP::Expect

2003-10-01 Thread Jose Malacara
I am using a proper hostname, and have even tried several different hosts. I just left it out of the example I sent to the list. I verified all the login, hostname, filename, password, etc by scp the file manually. I have even loaded the modules on another machine and I still get the same error. -

uploadfiles

2003-10-01 Thread A L
Hi, I'm trying to write a CGI script to upload a file from a website. I have the following HTML: Uploading Files Pick a file to upload: that refers to the following CGI: #!/usr/bin/perl -w use strict; use CGI qw/:standard/ print "Content-type: text/html\n\n"; print $query->filefi

Re: Look At This Package

2003-10-01 Thread James Edward Gray II
On Tuesday, September 30, 2003, at 09:04 PM, [EMAIL PROTECTED] wrote: Thank for you help. Now asome enlighten questions. - Are the fname and lname implicitly declared? These are now really variables, they're just keys to the hash we made into an object. - I guess you can't have vars outside of

Re: convert UNIX timestamp

2003-10-01 Thread Mike Blezien
thx's, I knew it was something simple... just needed a reminder. -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Quality Web Hosting http://www.justlightening.net MSN: [EMAIL PROTECTED] =-=-

RE: index

2003-10-01 Thread TN
Looks like they are what translates the embedded arithmetical symbols (in $line as a text string) into perl arithmetical operators, performs the indicated calculation and prints the result. The reason for 0 < index() is to ensure that the arithmetical symbols don't begin the line which is part the

RE: index

2003-10-01 Thread Thomas Bätzler
Ronen Kfir asked: > The following script meant to calculate simple math drills, > such as 5 * > 9 or 4 + 3, written in one line. What I cannot comprehend is the lines > marked with ---. What do they do? Why is there a "0 < index..." That looks like somebody wrote a C p

Re: convert UNIX timestamp

2003-10-01 Thread Jeff Westman
Mike Blezien <[EMAIL PROTECTED]> wrote: > Hello, > > how can one convert a unix timestamp to a readable date/time format. I know > there's a module to do this, but don't recall which one is used. IE. > convert the unix timestamp: 1064616515 > > thx's > Mickalo perl -e "print scalar localtime()

RE: convert UNIX timestamp

2003-10-01 Thread Hall, Scott
Mickalo, perldoc -f localtime perldoc -f gmtime > perl -e 'print scalar localtime (1064616515), "\n"' Fri Sep 26 18:48:35 2003 Scott -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 10:08 AM To: [EMAIL PROTECTED] Subject: convert UNIX tim

convert UNIX timestamp

2003-10-01 Thread Mike Blezien
Hello, how can one convert a unix timestamp to a readable date/time format. I know there's a module to do this, but don't recall which one is used. IE. convert the unix timestamp: 1064616515 thx's Mickalo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Intern

Re: Look At This Package

2003-10-01 Thread James Edward Gray II
On Tuesday, September 30, 2003, at 08:44 PM, [EMAIL PROTECTED] wrote: OK version x.3 Please just change these lines to make it work. The calling program test.pl fails on the assignment line: Will do, but I'm not 100% sure you're listening to the suggestions we give. Bareword "fname" not allowed

Re: Fw: Net::SCP::Expect

2003-10-01 Thread R. Joseph Newton
Jose Malacara wrote: > Sorry if this comes across twice. It bounced back the first time... > > Would someone mind telling me what I am doing wrong here please. I am trying to tie > the SCP Expect module into a backup script I put together, but it keeps failing. I > stripped out all but the SCP e

RE: index

2003-10-01 Thread Ronen Kfir
Sorry about the last one. I wrote some test & somehow it flipped away! The following script meant to calculate simple math drills, such as 5 * 9 or 4 + 3, written in one line. What I cannot comprehend is the lines marked with ---. What do they do? Why is there a "0 < index..." Oh, it all makes

Re: @ARGV

2003-10-01 Thread R. Joseph Newton
"Dillon, John" wrote: > According to > http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/argv.html > the following program will do ...whatever (make a backup of files) and it > takes the file specified at the command line. I guessed from this that one > has a .pl file with the fol

Re: Getting started in Perl for OSX

2003-10-01 Thread James Edward Gray II
On Wednesday, October 1, 2003, at 04:57 AM, Dillon, John wrote: I got an iBook recently with OSX 10.2.4. It's UNIX based. Allegedly 10.1+ has Perl pre-installed but I couldn't find it. All versions of Mac OS X have shipped with Perl installed and ready to go. Perl is a command line UNIX app

RE: owner's name of a file

2003-10-01 Thread EUROSPACE SZARINDAR
Hi Josimar, Have a look at perldoc -f stat and getpwuid. You should afterwards transform the $uid into the literal name of the user using /etc/passwd. try : $Uid = (stat('c:\Config.sys'))[4]; $UserName = ( getpwuid( $Uid ))[0]; Michel -Message d'origine- De: Josimar Nunes de Olive

Re: Getting started in Perl for OSX

2003-10-01 Thread deborah
Do you know how to bring up a terminal on your mac? If not, that's where to start. Find the utilities directory and you'll see the Terminal utility. Then just click on it and a new terminal window should open. Then enter any perl command, such as whereis perl and voila, you should see perl

RE: index

2003-10-01 Thread Stephen Hardisty
Oh, it all makes sense now. what are you going on about man? > Hi, > > > my $line = ; > chomp $line; > > my $first_space = index($line , " "); > > my $a = substr($line, 0, $first_space); > > > > my $last_space = rindex($line , " "); > my $b = substr($line, $last_space+1); > > > >

index

2003-10-01 Thread Ronen Kfir
Hi, my $line = ; chomp $line; my $first_space = index($line , " "); my $a = substr($line, 0, $first_space); my $last_space = rindex($line , " "); my $b = substr($line, $last_space+1); if (0 < index($line, "*")) { print $a * $b, "\n"; } if (0 < index($line, "+")) { print $a + $b,

Re: extending modules

2003-10-01 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: [...] > This worked better and was easier (once I remembered to update 'ISA@') > than I expected! I ended up adding two or three new methods and modifying > four. Errr, ah "@ISA"... (that was the Hebrew notation maybe). -- Kevin Pfeiffer In

how to know if a module is "stock" (i.e. comes with Perl install)

2003-10-01 Thread Kevin Pfeiffer
I have a feeling this a FAQ... I've CPANed so many modules I no longer know which came with Perl and which not. How can I determine this? Thanks in advance! -- Kevin Pfeiffer International University Bremen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

owner's name of a file

2003-10-01 Thread Josimar Nunes de Oliveira
Hello, How to get the owner's name of a file in a mapped drive from novell server? My OS is W2K. Thanks, Josimar

Getting started in Perl for OSX

2003-10-01 Thread Dillon, John
I got an iBook recently with OSX 10.2.4. It's UNIX based. Allegedly 10.1+ has Perl pre-installed but I couldn't find it. So I've downloaded the right version for Mac OSX. I have the same problem as I had in the thread 'Getting started in Perl for Windows'. What now? With Windows, I was direc

RE: is there away to regex

2003-10-01 Thread Jerry Preston
Kevin, I am converting c to basic. Bad stuff! Thanks, Jerry -Original Message- From: Kevin Pfeiffer [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 4:23 AM To: [EMAIL PROTECTED] Subject: Re: is there away to regex In article <[EMAIL PROTECTED]>, Jerry Preston wrote: > Hi

Please clip text or not top-post [Was RE: Look At This Package]

2003-10-01 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > It did complain or else I would have sent a thank you for making it work > already ;) [long, upside clipped] Please at least clip the old text if you are going to top-post. We're mostly "top-to-bottom" readers here (makes following code

Re: is there away to regex

2003-10-01 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Jerry Preston wrote: > Hi! > > Is it possible to combine the following into one: > > s/^\s+;//; > s/\/\*/!/; > s/\*\///; s/^\s+;//; s/\/\*/!/; s/\*\///; # ;-) Why would you want to? (Not that I know if you can) It's easier to see

Re: extending modules

2003-10-01 Thread Kevin Pfeiffer
Hi, In article <[EMAIL PROTECTED]>, Jeff 'Japhy' Pinyan wrote: > Typically, you create a sub-module. > > package Unix::AliasFile::Extended; > use base 'Unix::AliasFile'; > > sub changed_method { ... } > sub new_method { ... } > > 1; > > Then you just use Unix::AliasFile::Extended in

is there away to regex

2003-10-01 Thread Jerry Preston
Hi! Is it possible to combine the following into one: s/^\s+;//; s/\/\*/!/; s/\*\///; Thanks, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: validate chars for a string

2003-10-01 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Since, everyone is so lively today, I'm going to push my luck today with > this list. I need a little help here with validating a string to have only > characters that I want, A-z and _ (underscore). > > So, this is what I'm stuck on: In what way are you stuck? > > > #