Re: random string

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 08:02:00AM +0530, [EMAIL PROTECTED] wrote: > Hi, > > why would you want to use Perl in the first place? no other alternatives? > Maybe, But I am not a coder at all. > > your problem is straight forward and if you are not familiar with Perl, you > > might want to go with ano

Checking for multiple instances of a string

2002-11-23 Thread Gavin Laking
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi folks, I've configured the forum software I am writing to automatically add the line 'Re: subjectNameHere' to the subject field when a user wishes to reply to a post. Now I've encountered a problem, when the reply is a reply to a previous reply: *

RE: Checking for multiple instances of a string

2002-11-23 Thread Beau E. Cox
Hi- Try: #!/usr/bin/perl use strict; use warnings; my $subject = "Re: Re: Re: Re: Howdy"; print "origonal: $subject\n"; $subject =~ s/(Re:\s)+/$1/g; print "final: $subject\n"; (tested) Dress it up as you wish, i.e. .../gi; is a cassless match, etc. Aloha =>

clear screen

2002-11-23 Thread SATAR VAFAPOOR
Hi everyone, I have a couple of questions; 1) is there a command to clear the screen from within a perl program 2) how can you send the ouptput to the printer from within a perl program I am running perl on windows. Thanks - Do you Yahoo!? Yahoo! Mail Plus -

Re: random string

2002-11-23 Thread rpayal
Hi, > By now you will probably have worked out that this community is very > happy to help people of any ability to improve their Perl skills, but is > rather reluctant just to hand out ready-made solutions. This is as it *please read the mail in full before commenting on *anything*. * Yep, but th

Re: random string

2002-11-23 Thread rpayal
Hi, Thanks for the mail. > perldoc -f rand > also, > perldoc perlop Thanks, I will. > If that doesn't work, try asking your professor for help. hehehehehee, I don't have any professor. I am not a student and I never was a computer student. I am just a artist in fashion designing who does Linux as a

Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Hi All; I'm trying to match a pattern in a text file and then print out the next line in that file. I could swear that I've done this before by incrementing $. to move to the next line. However, the code below is printing out the matched line rather than the next line. #!/usr/bin/perl open (LO

how to return the array from a reference?

2002-11-23 Thread todd shifflett
I have a subroutine which makes a number of recursive calls and uses as input a scalar reference from an array. I am able to retrieve the number from the reference, however, I would also like to print out the array and index information that was used. Ultimately I get this: (A) SCALAR(0x47

Module NET:LDAPapi question

2002-11-23 Thread Paul Harwood
I am having a ton of difficulty getting this to work on my WIN32 system. I copied the LDAPapi.PM file to the c:\perl\lib\Net folder but I still keep getting errors. Is there something simple I am missing? Can't locate loadable object for module Net::LDAPapi in @INC (@INC contains: C:/Perl/lib C:/P

changes to CGI module?

2002-11-23 Thread todd shifflett
I have a cgi script which used to run very well. Now, after setting up a new computer and installing a more recent version of CGI.pm I recieve errors: this used to be all I needed: use CGI qw/:all *table td tr/; to do the folowing: print $q->start_table(); print $q->tr( $q->td()); print $

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
You could always say again inside your if to print the next line. Realize that you will not then be able to check that line for the string, but if that is ok which it sounds like it is then it should work. See below. Joshua Kaufman wrote: Hi All; I'm trying to match a pattern in a text file

Characters instead of regex patterns

2002-11-23 Thread Jason Rauer
Say I have: foreach $string (@strings) { if ($text =~ /$string/) { ... } } Now, it happens that the data in $string contains \|()[{$^*.? etc. that turn into regex metacharacters within m// but I want to match them by their literal value, not as a regex pattern. That is, now Perl terminates the

Re: Checking for multiple instances of a string

2002-11-23 Thread dan
$retest = substr($linewithsubjectin,3); if ($retest ne "Re:") { # hasn't got Re: in } else { # has got Re: in } should work. dan "Gavin Laking" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi folks,

Using Mail::Sender

2002-11-23 Thread Tin-Shan Chau
Using the following program, I managed to send a message with an attachment to multiple recipients using option 2, but not with options 1 and 3: >> use Mail::Sender; $address1 = '[EMAIL PROTECTED]'; $address2 = '[EMAIL PROTECTED]'; #$recipients

Re: Characters instead of regex patterns

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 10:45:40AM +, Jason Rauer wrote: > Say I have: > > foreach $string (@strings) { > if ($text =~ /$string/) { ... } > } > > Now, it happens that the data in $string contains \|()[{$^*.? etc. that > turn into regex metacharacters within m// but I want to match them by

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Bob - Thanks, I'll investigate that. I'm also hoping that the list will tell me how to do it by incrementing the proper special variable. I could swear that I've done that before, and have found it useful in other contexts. -- Josh -- On 11/23/02 12:39 PM, "Mystik gotan" <[EMAIL PROTECTED]> w

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Thanks for the reply. That would work in this context, but I'm looking for the more general answer, mostly just to convince myself that I'm not crazy and have done it this way before. --Josh On 11/23/02 8:44 AM, "Wiggins d'Anconia" <[EMAIL PROTECTED]> wrote: > You could always say again insid

Re: Characters instead of regex patterns

2002-11-23 Thread Mystik gotan
Maybe you should use a foreach loop spitting every character and then parsing the \ in front of it? Sincerly, Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net From: "Jason Rauer" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Characters instead of regex patterns Date: Sat, 2

Re: Match pattern and print next line

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 02:05:58PM -0600, Joshua Kaufman wrote: > Thanks for the reply. > > That would work in this context, but I'm looking for the more general > answer, mostly just to convince myself that I'm not crazy and have done it > this way before. I'm sorry to report that you may be c

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
How unfortunate for me ;-) -- josh On 11/23/02 2:17 PM, "Paul Johnson" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 23, 2002 at 02:05:58PM -0600, Joshua Kaufman wrote: > >> Thanks for the reply. >> >> That would work in this context, but I'm looking for the more general >> answer, mostly just to co

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
Yeh I would tend to agree, based on the fact that you can have multiple handles open at the same time. So there would have to be like a hash or something if it were a special variable which you would have to update for each handle, on top of that you can make a handle a lexical variable which d

Re: Characters instead of regex patterns

2002-11-23 Thread Wiggins d'Anconia
You should be able to \ them just like any other character, if that isn't working you might try backslashing the \. Aka, \\ or even . http://danconia.org Mystik gotan wrote: Maybe you should use a foreach loop spitting every character and then parsing the \ in front of it? Sincerly, Bob

Some few basic Perl questions

2002-11-23 Thread Mystik gotan
Hiya, I got some basic Perl questions. Hope you don't mind answerring them? 1) What is the use of just putting $var; on 1 line? Example: #!usr/bin/perl -wT # some code $var; Does this technique rescopes the variable? 2) Why is exit() or 1; used on the LAST line. I understand it being on some l

Re: How to tally money datatype?

2002-11-23 Thread chris
On Fri, 22 Nov 2002 21:21:42 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote: >Chris wrote: >> >> How do I tally money with perl? > >Assuming that you are tallying dollars like $12,345.67, convert to cents >(an integer) by removing all punctuation and convert back to dollars to >print the final to

Re: How to tally money datatype?

2002-11-23 Thread chris
On Fri, 22 Nov 2002 21:21:42 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote: >Chris wrote: >> >> How do I tally money with perl? > >Assuming that you are tallying dollars like $12,345.67, convert to cents >(an integer) by removing all punctuation and convert back to dollars to >print the final to

Re: How to tally money datatype?

2002-11-23 Thread Paul Johnson
On Sat, Nov 23, 2002 at 06:06:12PM -0500, chris wrote: > How do I stop the warning message > Possible attempt to separate words with commas at > @dollars = qw/ $12,345.67 $11,555.99 $9,765.35 $432 $876.4 /; no warnings "qw"; It is lexically scoped. -- Paul Johnson - [EMAIL PROTECTED] http://ww

RE: Some few basic Perl questions

2002-11-23 Thread Beau E. Cox
Hi - Putting a value or variable alone on the last line of a scope like: sub something { blah, blah, blah... ... 1; } implies 'return 1;'. The subroutine (or scope) returns the value last evaluated. The function 'exit' or 'exit 99' does just that, exits the script to the os (or whoever calle

script review

2002-11-23 Thread Andrei Faust Tanasescu
Hello there list! I am eager to hear your feedback on this script I wrote. Its reason of being is to be ran from cron (under Linux) so it warns root and cuts internet conenction whenever download or upload reaches a certain limit. This because our ISP bills us $10c for every megabyte of data ove

Re: Match pattern and print next line

2002-11-23 Thread John W. Krahn
Joshua Kaufman wrote: > > Hi All; Hello, > I'm trying to match a pattern in a text file and then print out the next > line in that file. I could swear that I've done this before by incrementing > $. to move to the next line. However, the code below is printing out the > matched line rather than

MySQL

2002-11-23 Thread Mariusz
I sent the following mysql query and got an error:( SELECT ad_id, text_extra, life FROM help_wanted WHERE ad_id in(@id_set) It prints correctly as: SELECT ad_id, text_extra, life FROM help_wanted WHERE ad_id in(20 19 14) but the whole idea doesn't work; what am I missing? Mariusz

Re: Characters instead of regex patterns

2002-11-23 Thread John W. Krahn
Jason Rauer wrote: > > Say I have: > > foreach $string (@strings) { > if ($text =~ /$string/) { ... } > } > > Now, it happens that the data in $string contains \|()[{$^*.? etc. that turn > into regex metacharacters within m// but I want to match them by their > literal value, not as a regex pa

Re: How to tally money datatype?

2002-11-23 Thread John W. Krahn
Chris wrote: > > OK. I will try it. My amounts look more like this. > > @dollars = qw/ 12345.67 -12345.67 11555.99 -11555.99 9765.353 ^^^^ ^^^ > -9765.353 432 -432 876.4 -876.4/; ^^^ You are going to have to decide if

Re: How to tally money datatype?

2002-11-23 Thread John W. Krahn
Chris wrote: > > How do I stop the warning message > Possible attempt to separate words with commas at > @dollars = qw/ $12,345.67 $11,555.99 $9,765.35 $432 $876.4 /; my @dollars = ( '$12,345.67', '$11,555.99', '$9,765.35', '$432 $876.4' ); John -- use Perl; program fulfillment -- To unsubs

Re: MySQL

2002-11-23 Thread George Schlossnagle
the list in your statement needs commas $query = "SELECT ad_id, text_extra, life FROM help_wanted WHERE ad_id in(".join(',', @id_set).")"; On Saturday, November 23, 2002, at 08:30 PM, Mariusz wrote: I sent the following mysql query and got an error:( SELECT ad_id, text_extra, life FROM help_

Re: How to tally money datatype?

2002-11-23 Thread chris
On Sat, 23 Nov 2002 18:44:58 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote: >Chris wrote: >> >> OK. I will try it. My amounts look more like this. >> >> @dollars = qw/ 12345.67 -12345.67 11555.99 -11555.99 9765.353 > ^^^^ ^^^

Re: How to tally money datatype?

2002-11-23 Thread John W. Krahn
Chris wrote: > > On Sat, 23 Nov 2002 18:44:58 -0800, [EMAIL PROTECTED] (John W. Krahn) > wrote: > > >Chris wrote: > >> > >> OK. I will try it. My amounts look more like this. > >> > >> @dollars = qw/ 12345.67 -12345.67 11555.99 -11555.99 9765.353 > >

Re: Some few basic Perl questions

2002-11-23 Thread dan
i'm unsure about the first question, but your answer to the 2nd one, is, if you are using more than 1 script in your program, and you require() it, the script that's require()'d must have 1; as the last line. this way, perl knows it's the end of the file, and not to read any further. it returns a "

Re: How to tally money datatype?

2002-11-23 Thread chris
On Sat, 23 Nov 2002 19:42:21 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote: > >If rounding does what you want then that should be fine. However, if >you want to truncate this is one way to do it: > >my $amount = 11555.99; > >$amount =~ s/(?<=\.\d\d)\d+$//; > > > >John So to put it all togeth

Advice wanted on project

2002-11-23 Thread Steve Gross
I'm about to start a project and I'm looking for some pointers. Specifically, I want to create a call center/help desk/tracking system. My idea is to use HTML and a web browser as a front end and SQL Server as the database. The middle tier is undecided but includes a web server and of course I w

Re: Advice wanted on project

2002-11-23 Thread Chris Ball
>> On Sun, 24 Nov 2002 01:13:52, Steve Gross <[EMAIL PROTECTED]> said: > 4) Are there any call tracking/help desk systems out there to look > at? Thanks for any help. Request Tracker[1] is a *very* featureful ticket tracking system using HTML/CGI as a front-end to a database. I've used it