RE: dbi module for ActivePerl

2002-03-17 Thread yahoo
Hytham, from a command prompt type 1) PPM 2) INSTALL DBI it really is that simpe :-) regards Joel -Original Message- From: Hytham Shehab [mailto:[EMAIL PROTECTED]] Sent: 13 March 2002 12:59 To: [EMAIL PROTECTED] Subject: dbi module for ActivePerl Hello!, i use perl from

perl

2002-03-17 Thread Charles Fletcher
i'm a beginner were do we start, lol, please let me know ok.. thank you very much.. charles

Using CGI.pm

2002-03-17 Thread Octavian Rasnita
Hi all, I have a question about using CGI.pm. How it is better? To print directly the html code with print html head title .../title /head; etc. or to print using the CGI.pm print $q- start_html(...); etc. Does it work faster in a way or another, or are there any advantages? I saw that

Why doesn't it work?

2002-03-17 Thread Octavian Rasnita
Hi all, I tried the following line to open another location, but it doesn't work. print $screen - redirect(-uri='http://localhost/index.html'); It doesn't redirect to another location. It just prints the following: Status: 302 Moved Location: http://localhost/index.html Do you have any idea

Re: dbi module for ActivePerl

2002-03-17 Thread Hytham Shehab
thanks joel, but i try to see the available drivers with @x=DBI-available_drivers; it gives me Example and Proxy, with no sign of MySQL - mysql is installed and working properly with other version of perl, ie perl from perl.com - so what is the problem. thanks in advance. -- Hytham Shehab

RE: Re[2]: param function

2002-03-17 Thread Gary Hawkins
print CGI::header(); print hello\n; print foo\n; print bar\n; foreach my $line (FILE) { my $result = do_something($line); } use LWP::Simple; my $credit_card_server = secure.mybank.com; my $username = my_secret_username; my $password = my_password; for $name

Re: limiting a regular expression

2002-03-17 Thread Mark Maunder
What are you trying to match? If it's just the dir name then: /\/(tmp_\w)/ will do it and set $1 to equal your directory name. ~mark. http://www.workzoo.com/ Zysman, Roiy wrote: Hi All, As we all know Regular Expressions are very greedy and tries to big as big as possible. How do i limit

Re: foreach loop :(

2002-03-17 Thread Mark Maunder
You have two dollar signs before the 'name' variable in the loop. That probably works provided the value of the variable is not a number, but it may be causing the strangeness you're experiencing. Always 'use strict' in your scripts. You should be storing your params in a hash and doing

Re[2]: Cleaning poorly formated csv files

2002-03-17 Thread Daniel Gardner
Sunday, March 17, 2002, 12:18:01 AM, Dave Chappell wrote: Thanks. I got lots to learn about perl, thinking for the 2 hours I was trying to solve my issue with chomp and split. I have began disecting your reponse to learn from it. One question, the last print statement: print $_ . \n; what

Width of an Image

2002-03-17 Thread Motherofperls
Hi everyone, I'm writing a CGI program that requires that I discover the dimensions of an image that a person uploads. Can perl or javascript do that? Thanks Tricia

Re[2]: foreach loop :(

2002-03-17 Thread Daniel Gardner
Sunday, March 17, 2002, 10:41:01 AM, Mark Maunder wrote: You have two dollar signs before the 'name' variable in the loop. That probably works provided the value of the variable is not a number, but it may be causing the strangeness you're experiencing. Always 'use strict' in your scripts.

Re: Width of an Image

2002-03-17 Thread Daniel Gardner
Sunday, March 17, 2002, 12:43:07 AM, [EMAIL PROTECTED] wrote: I'm writing a CGI program that requires that I discover the dimensions of an image that a person uploads. Can perl or javascript do that? The Image::Size module on CPAN does exactly that:

RE: Cleaning poorly formated csv files

2002-03-17 Thread Jonathan E. Paton
Thanks. I got lots to learn about perl, thinking for the 2 hours I was trying to solve my issue with chomp and split. I have began disecting your reponse to learn from it. One question, the last print statement: print $_ . \n; since ($Jonathan eq Fool) { Opps... I've abondoned my

Re: Width of an Image

2002-03-17 Thread Mark Maunder
Also, check out PerlMagick - a perl interface into the ImageMagick library of image manipulation. The homepage is at: http://www.imagemagick.org/www/perl.html You can resize images to create thumbnails, and insert text into images (like your site's URL for example) and do a bunch of other cool

RE: limiting a regular expression

2002-03-17 Thread Zysman, Roiy
I'm sorry if i wasn't clear after tmp_ can come any character for example tmp_6676frf877 or tmp_hbhbbd3y78783xcbh how can i limit my regex to catch any character but not / Thx Roiy -Original Message- From: Mark Maunder [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 17, 2002 12:13 PM To:

Re[2]: limiting a regular expression

2002-03-17 Thread Daniel Gardner
Sunday, March 17, 2002, 1:10:16 PM, Zysman, Roiy wrote: I'm sorry if i wasn't clear after tmp_ can come any character for example tmp_6676frf877 or tmp_hbhbbd3y78783xcbh how can i limit my regex to catch any character but not / Thx Roiy how about m|/(tmp_[^/]+)|; which says, match a /,

Line numbering.

2002-03-17 Thread gkotsovilis
How do you keep line numbering straight in a perl script. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl Tk.

2002-03-17 Thread zentara
On Fri, 15 Mar 2002 16:03:03 -0500, [EMAIL PROTECTED] (Peter Farrar) wrote: I've been growing interested in the Tk module too. I found this today. It's really really introductory. http://www.perl.com/pub/a/1999/10/perltk/ I am planning to write a litte graphical interface for an application

Re: Line numbering.

2002-03-17 Thread Jenda Krynicky
From: gkotsovilis [EMAIL PROTECTED] How do you keep line numbering straight in a perl script. Beg your pardon? What line numbering? How is it not straight? What do you do, what do you expect and what do you get? Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==

Re: Line numbering.

2002-03-17 Thread Jonathan E. Paton
How do you keep line numbering straight in a perl script. No code example? I can only assume you want: while () { printf %.5d: %s, $., $_; } or maybe: while () { printf %5s: %s, $., $_; } or even: perl -n -e 'printf%.5d: %s,$.,$_' Clear description of your requirements is

Re: Line numbering.

2002-03-17 Thread Mark Maunder
Perhaps you learnt to program with something like Apple Basic like I did nostalgia modewhen I was 10 years old on the Apple IIe/nostalgia mode which requires line numbers. Perl doesn't need them. gkotsovilis wrote: How do you keep line numbering straight in a perl script. -- To unsubscribe,

RE: Line numbering.

2002-03-17 Thread Timothy Johnson
Whoa. That brings back memories. The scary thing is that two years ago I was working at a place that still had their entire inventory/purchasing/HR system was programmed in BASIC. They didn't seem to get it when I pointed out that anyone could press ^C, GOTO the line were the passwords were

Re: count consonnant

2002-03-17 Thread Jonathan E. Paton
I am trying to create a script that read a file and count consonnant then output the results to another file. I would ask here if anybody can help me to write the script. Does this sound like homework or what? 1. the c at the end of words 2. the cc at the end of words 3. the cing at the

RE: count consonnant

2002-03-17 Thread Timothy Johnson
I guess you're not familiar with dancc scripting? :) At the very least, if you must ask for help because you're stuck on something, ask for help on the thing you're stuck on, don't just ask someone to write it for you. People charge for that sort of thing. -Original Message- From:

Attacking this wrong? Syslog sort extract question

2002-03-17 Thread swansong
I'm fairly certain I'm attacking this incorrectly, so any advice is greatly appreciated... Task: I want to sort through my Solaris syslog (/var/adm/messages) looking for any system reboots which always start with the string SunOS and, if found, return that line and the next 20 lines, at least

Re: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread John Lawrence
I'm no expert myself, so I can't comment on the perl, but if as you say the SunOS is at the start of the line. reboots which always start with the string SunOS and, if found, return You may want to put a ^ in your regex to fix this. So, if ($_ =~ /SunOS/) becomes: if ($_ =~

Re: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread Daniel Gardner
Sunday, March 17, 2002, 9:44:49 PM, swansong wrote: I'm fairly certain I'm attacking this incorrectly, so any advice is greatly appreciated... Task: I want to sort through my Solaris syslog (/var/adm/messages) looking for any system reboots which always start with the string SunOS and,

Re: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread swansong
My apologies for the 3 posts, netscape kept crashing so my last one from IE is the newest code... my dilemna isn't that it starts at the beginning of the line, the regex, as it doesn,'t. rather, how do I say open file, read file, for every occurrence of regex, print that line + the next 20

RE: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread Wagner-David
Here is a simplistci approach which does what you want: while ( FILE ) { next if ( ! /SunOS/ ); printf The desired line's number is $.\n; print $_; for ($i = 0; $i 20; $i++) { $_ = FILE; print $_; } } Tested gave the corrct line number, SunOs plus 20 more

Re: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread Elaine -HFB- Ashton
swansong [[EMAIL PROTECTED]] quoth: *I'm fairly certain I'm attacking this incorrectly, so any advice is *greatly appreciated... Well...there are easier ways to do it. Let syslog do the work for you and add 'kern.debug /var/adm/kern_debug.log' to /etc/syslog.conf [ the space must be a tab

Re: Attacking this wrong? Syslog sort extract question

2002-03-17 Thread John W. Krahn
Swansong wrote: I'm fairly certain I'm attacking this incorrectly, so any advice is greatly appreciated... Task: I want to sort through my Solaris syslog (/var/adm/messages) looking for any system reboots which always start with the string SunOS and, if found, return that line and the

Re: foreach loop :(

2002-03-17 Thread bob ackerman
works for me, so nothing wrong with your perl code. maybe you could show us the url you are using to reach this code. On Saturday, March 16, 2002, at 10:34 PM, Mariusz wrote: html tags are not the problem. I included another print statement before the loop and that outputs text 1 here to

xmit Perl code for carriage return during telnet session

2002-03-17 Thread John
I do not understand the results of the following experiment, and would appreciate input. Using telnet on a Win PC, I executed this code: perl -e ‘print Hello world.\n\r' /dev/tty1 On my Linux system monitor (/dev/tty1), I see Hello world. printed along with the newline and carriage

Re: xmit Perl code for carriage return during telnet session

2002-03-17 Thread Daniel Gardner
Hello John, Monday, March 18, 2002, 5:15:18 AM, John wrote: I do not understand the results of the following experiment, and would appreciate input. Using telnet on a Win PC, I executed this code: perl -e ‘print Hello world.\n\r' /dev/tty1 On my Linux system monitor

Re: message to cell phones

2002-03-17 Thread Steven Maroney
most providers such as Sprint PCS has a web interface/cgi script that allows a visitor to send a text message to a sprint phone. On Mon, 11 Mar 2002, Joyce Harris wrote: I am looking for info on how to send an alert message to a cell phone from a perl script. Any ideas? -- To

Adding the input file digits together

2002-03-17 Thread Bruce Ambraal
Hi I am want to add digits in In_digits together. Print total to screen. Could someone help? Thanx Bruce In_digits: 1,200 2,400 #!/usr/bin/perl -w open(INPUT, In_digits) || die; open(OUTPUT, Out_digits) || die; while (INPUT) { if (/(\d{1})(\,)(\d{3})/) { print

RE: xmit Perl code for carriage return during telnet session

2002-03-17 Thread John
Daniel, Thanks for the suggestion, but I'd already tried that variation-on-a-theme with no luck. I'm really looking for the right code to have telnet execute an Enter key function at the finish of my perl script. John-- -Original Message- From: Daniel Gardner [mailto:[EMAIL

Adding the input file digits together (Come on guys)

2002-03-17 Thread Bruce Ambraal
Hi I am want to add digits in In_digits together. Print total to screen. Could someone help? Thanx Bruce In_digits: 1,200 2,400 #!/usr/bin/perl -w open(INPUT, In_digits) || die; open(OUTPUT, Out_digits) || die; while (INPUT) { if (/(\d{1})(\,)(\d{3})/) { print

RE: Adding the input file digits together (Come on guys)

2002-03-17 Thread Timothy Johnson
I think you have most of this solved. You even already have the numbers in a variable, ready to use. In the following line, if (/(\d{1})(\,)(\d{3})/) { the part of the string that is represented by each set of parentheses within the match is assigned a numeric variable ($1, $2, etc.). So