Re: html in a cgi script

2002-03-22 Thread zentara
On Thu, 21 Mar 2002 16:09:42 -0600, [EMAIL PROTECTED] (Camilo Gonzalez) wrote: Can someone resend the regex they formulated for checking for valid emails? I seem to have accidently deleted it. Thanks Go to www.cpan.org and get the Email-Valid module, the regex is in Valid.pm. -- To

Re: Mod_perl

2002-03-22 Thread zentara
On Fri, 22 Mar 2002 01:00:48 -0800 (PST), [EMAIL PROTECTED] (Rob Roudebush) wrote: I have created basic forms using CGI.pm and now I'm interested in using Apache mod_perl to speed things up and use associated apache modules. Question: Can I continue to program using regular CGI, using

help with setings

2002-03-22 Thread maxa
Hello to all, I dont know how to set dbi connection to make connection whith database EmplDir_MSAccess.mdb -Create database connection string, login and password variables my $strConn = EmplDir_MSAccess.mdb; my $strLogin = Admin; my $strPassword = ; -Open the connection $dbh =

Re: help with setings

2002-03-22 Thread Kim, Kiseok
Maxa wrote: Hello to all, I dont know how to set dbi connection to make connection whith database EmplDir_MSAccess.mdb -Create database connection string, login and password variables my $strConn = EmplDir_MSAccess.mdb; my $strLogin = Admin; my $strPassword = ; -Open the

Uploading

2002-03-22 Thread Octavian Rasnita
Hi all, I don't understand something. When I upload a file from my computer to a server, I choose a local file, I open it, then I print its content into another file. But if I want to upload a file from my local /htdocs/ folder into the /images/ folder on the server, how could Perl know that the

Re: Uploading

2002-03-22 Thread fliptop
Octavian Rasnita wrote: When I upload a file from my computer to a server, I choose a local file, I open it, then I print its content into another file. But if I want to upload a file from my local /htdocs/ folder into the /images/ folder on the server, how could Perl know that the

Perl DATABASE Forms

2002-03-22 Thread Brice, Charles
Hi all I work in an ORACLE Forms environment. The client is switching to Perl. Is it possible to create a complete data entry system for the Web using Perl? ORACLE Forms allows you to create multiple data entry blocks in a form and to support 1 to many 1 to many relationships using multiple

RE: Perl DATABASE Forms

2002-03-22 Thread Scot Robnett
You might try Programming the Perl DBI (O'Reilly) perldoc CGI.pm perldoc DBI.pm http://search.cpan.org/doc/JURL/DBD-ODBC-0.39/ODBC.pm http://search.cpan.org/doc/TIMB/DBD-Oracle-1.12/Oracle.pm http://www.mysql.com Scot Robnett inSite Internet

RE: Perl DATABASE Forms

2002-03-22 Thread Brice, Charles
Hi David I am new to Perl. Our sys admin has Apache installed and is setting up for us to use Perl, DBI, CGI. Thanks for responding Charles -Original Message- From: David Kirol [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:40 PM To: Brice, Charles Subject: RE: Perl

re: callin subs

2002-03-22 Thread Matthew Harrison
is there something that says a variable doesn;t get passed when calling a sub in the same script? i am working on a web-based role-playing game and this is the script for inside the temple: #!/usr/bin/perl ##Modules## use CGI qw/:standard/; use CGI::Carp

Re: callin subs

2002-03-22 Thread Matthew Harrison
all sorted now, thanks to you experts. it was because I have prefixed my variables with 'my' which restricted them. On Friday 22 Mar 2002 3:34 pm, Matthew Harrison wrote: is there something that says a variable doesn;t get passed when calling a sub in the same script? i am working on a

my first regex i think

2002-03-22 Thread Matthew Harrison
if i have a file delimited by commas and i want to make a script that will search to see if a word, passed in a query string, is in the file, and redirect to one url if i does and one if it doesn't (both urls are also passed via query strings) thanks in advance -- Matthew Harrison

Re: my first regex i think

2002-03-22 Thread Michael Kelly
On 3/22/02 1:26 PM, Matthew Harrison [EMAIL PROTECTED] wrote: if i have a file delimited by commas and i want to make a script that will search to see if a word, passed in a query string, is in the file, and redirect to one url if i does and one if it doesn't (both urls are also passed via

RE: my first regex i think

2002-03-22 Thread Scot Robnett
This is not the cleanest example, but hopefully it will get you going in the right direction #!/usr/bin/perl use strict; my $file = /path/to/file; # location of the file my $firstword = foo; # 1st search word my $firstlocation = http://www.location1.com;; # 1st URL my $secondword = bar; #

RE: my first regex i think

2002-03-22 Thread Scot Robnett
Whoops, had to fix a comment here... if ($one =~ /$firstword/) { # searches the 1st column for 1st word print Location: $firstlocation br; } elsif ($one =~ /$secondword/) { # searches **1st** column for 2nd word print Location: $secondlocation br; } else { print hr; }

need sorting help

2002-03-22 Thread Adam Wesselink
Hi all I'm trying to update a script originally written by someone else (yeehaw), and I'm having troubles with the sorting routine. here's the code snippet. sub list_files { #($name, $type, $size, $mtime, $mode) = $_; sites = keys %das_sites; sites = sort { lc($a) cmp lc($b) } sites

Sort of Conceptual, Syntax, and modules related questions

2002-03-22 Thread Connie Chan
Dear All, I have sort of questions, would you please give me some hint, even refering me to a perldoc would be nice too. 1. When I open a text file with *lines, however, I just want to read the first line, would this be a good idea ? open (FILE, textfile.txt); $firstline = FILE; close

MySQL

2002-03-22 Thread Babichev Dmitry
Hello, beginners. Sorry for offtopic. Could you help me. How i can decrease time demand fetching for a very simple query? (in my case i have trouble because table is very big) Where I can read about this? fanx. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

RE: MySQL

2002-03-22 Thread MECKLIN, JOE (ASI)
The MySQL book by DuBois (published by New Riders) will tell you everything you need to know about MySQL. Also, it sounds like you don't have any indexes built for your table if a very simple query is taking a long time. Indexes will decrease your time to almost nothing, unless your query is not

Re[2]: MySQL

2002-03-22 Thread Babichev Dmitry
Hello, JOE. You wrote 22 ìàðòà 2002 ã., 15:06:36: 1.indexes exist. 2.query like select count(some_table.itemID) from some_table where keywords like '%begin' or like 'end%'. 3.table ~70M. MJA The MySQL book by DuBois (published by New Riders) will tell you everything MJA you need to know

how to randomly choose mp3 from dir, print mp3_filename for emailing to a list

2002-03-22 Thread K Clark
linux environment. have o'reilly cookbook learning perl (2nd ed.). desire to randomly choose a filename of mp3 files in a directory containing only mp3's. then, write the name of this filename to a file that has http://myurl.org/mywebpath/...; inserted before the filename so that i end up

RE: how to randomly choose mp3 from dir, print mp3_filename for emailing to a list

2002-03-22 Thread Nikola Janceski
Ya gotta write it yourself. You should look at the function glob() and rand() for starters. -Original Message- From: K Clark [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 8:30 AM To: [EMAIL PROTECTED] Subject: how to randomly choose mp3 from dir, print mp3_filename for

RE: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list]

2002-03-22 Thread K Clark
Here's what i have, and here's the problem. and here's what i 'think' i have to learn/do to fix it: #/usr/bin/perl -w use strict; # # script to randomly choose a song # and embed html with a link to it # my @mp3 = glob(/www/mp3/*.mp3); # # put while statement my $mp3 =~ s#.*/##; srand; print

RE: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list]

2002-03-22 Thread Nikola Janceski
read up on substitution. You need to put the array through a foreach loop. foreach my $mp3 (@mp3s){ $mp3 =~ s#/www/mp3/##; } Can you e-mail me that MP3 (the one you used as an example)? -Original Message- From: K Clark [mailto:[EMAIL PROTECTED]] Sent: Friday, March

Printing the number of times phone number appear in a textfile

2002-03-22 Thread Bruce Ambraal
Hi all In the program below I am attempting to count the number of times that a phone number(purely digits) occurs in a file of text. I am not succeeding cause i end up counting all the digits of phone numbers that occurs. Could anyone help.

RE: Printing frequency of word occurence in paragraph

2002-03-22 Thread David Gray
In the program below I don't know when to stop the loop. (CTRL + d ) will just terminate the program, leaving the data via STDIN unattended, this is my problem. Lets define what I want to do: I want to print the frequency of every word at the beginning. and every word at the end of a

callin subs

2002-03-22 Thread Matthew Harrison
i have defined a sub using sub mysubname{ code here } but how do i call it? i have tried just having the name but that doesn't work. -- Matthew Harrison Internet/Network Services Administrator Peanut-Butter Cheesecake Hosting Services Genstate www.peanutbuttercheesecake.co.uk -- To

Re: Printing frequency of word occurence in paragraph

2002-03-22 Thread Adam Turoff
On Fri, Mar 22, 2002 at 09:37:05AM -0500, David Gray wrote: while(STDIN) will create an infinite loop, No, it won't. The while (FILEHANDLE) idiom will read one line at a time and automatically terminate the loop at the end of the file. so you do need some sort of sentinel value to break

RE: callin subs

2002-03-22 Thread Jason Larson
-Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Subject: callin subs i have defined a sub using sub mysubname{ code here } but how do i call it? i have tried just having the name but that doesn't work. -- Matthew Harrison mysubname(); If

How to reduce the time loading of a module ?

2002-03-22 Thread Patrice Boisieau
Hello In order to increase the time execution of a Perl script, I wonder if it is possible to reduce the time loading of a module at the compilation step. In particular, is the time loading reduced when just one of the symbols exported by the module is used ? I mean, does the instruction 'use

Exhaustive graph of subroutines

2002-03-22 Thread Patrice Boisieau
Hello Does it exist a CPAN module that computes the exhaustive graph of the subroutines of a script ? Example: Suppose script.pl contains the following code : sub routine_B2 { ... } sub routine_B1 { ... } sub routine_A2 { ... routine_B2(); ... } sub routine_A1 { ... routine_B1(); ... }

Comment reduire le temps de chargement d'un module ?

2002-03-22 Thread Patrice Boisieau
Bonjour, Afin d'ameliorer le temps d'execution des scripts, je me demande s'il est possible de reduire le temps de chargement des modules a la phase de compilation. En particulier, est-ce que le temps de chargement est reduit dans le cas ou un seul des symboles exportes par le module est

RE: Printing frequency of word occurence in paragraph

2002-03-22 Thread David Gray
I think this is a prime example of TMTOWTDI (There's More Than One Way To Do It) - you now have two choices for how to indicate the end of input to your while(STDIN) loop: 1) pressing ^Z instead of ^D 2) breaking out of your loop when you see certain input indicating end of input -dave ps - I

help with - use HTML::Template;

2002-03-22 Thread A Taylor
Hi all, Firstly, thanks for all your help, its really appreciated !! I emailed [EMAIL PROTECTED] and asked about using HTML templates instead of embedding my HTML in my perl scripts. It was suggested that I use the following code. - filename = sample.pl

RE: usefulness of perl for production?

2002-03-22 Thread Wagner-David
Yes Perl is very useful for doing the work stated, but the group needs to know from either a script you want to change or showing some code you desire to change, so they can assist and hopefully point you in the right direction. move,copy,rename can be handled by File::Copy

RE: usefulness of perl for production?

2002-03-22 Thread Mike Rapuano
HI Rebecca -- I an still a newbie but I really learned alot from this tutorial: http://www.netcat.co.uk/rob/perl/win32perltut.html After you go thru this tutorial then give learning perl a try. I bet it will be alot easier then:-) Best of luck; perl is really good for windoze admin stuff.

listing date ranges

2002-03-22 Thread rory oconnor
I am writing a perl front-end to create dynamic queries on a mysql database, and i'm a pretty new programmer! I want to offer the user a date range, and the dates I want to use are stored in records in my database: 2002-02-17 2002-02-24 2002-03-02 2002-03-09 2002-03-15 and I kow how to

Task::Scheduler Nice Windows module

2002-03-22 Thread Mike Rapuano
HI all -- Awhile ago I posted a question about accessing Windows Task Scheduler from Perl. Unfortunately, I didn't get a response. Anyways, I found a nice module and wanted to let everyone know incase someone wanted to use Task Scheduler from perl. http://taskscheduler.sourceforge.net Check

RE: Printing the number of times phone number appear in a textfile

2002-03-22 Thread Mark Anderson
First of all, you are only matching a single digit. You want to change your regular expression from /(\d)/ to /(\d+)/, which matches one or more digits, and slurps up as many as it finds in a row. One issue you will have is that a file containing addresses, you are also going to get a count on

Re: how to randomly choose mp3 from dir, print mp3_filename for emailing to a list

2002-03-22 Thread John W. Krahn
K Clark wrote: linux environment. have o'reilly cookbook learning perl (2nd ed.). desire to randomly choose a filename of mp3 files in a directory containing only mp3's. then, write the name of this filename to a file that has http://myurl.org/mywebpath/...; inserted before the

Re: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list]

2002-03-22 Thread John W. Krahn
K Clark wrote: Here's what i have, and here's the problem. and here's what i 'think' i have to learn/do to fix it: #/usr/bin/perl -w use strict; # # script to randomly choose a song # and embed html with a link to it # my @mp3 = glob(/www/mp3/*.mp3); # # put while statement my

I am clueless about making my test generator program to generate random questions.... Help

2002-03-22 Thread FLAHERTY, JIM-CONT
I have a script that generates test questions and grades them . I was asked to make them generate in a random order , can someone point me in the right direction They come in two files make_test.cgi and grade.cgi #! /usr/bin/perl # #make test for Cram Program # # version

send arguments to a tcl script

2002-03-22 Thread Roy Peters
I am writing a perl script. In it, I need to call another script that happen to be written in tcl. I need to pass arguments to that tcl script. Also, I need to get some return values from that tcl script. What is the best way for me to do that? Thanks.

RE: I am clueless about making my test generator program to generate random questions.... Help

2002-03-22 Thread Nikola Janceski
This worked for me while I was a TA. my $numberOfStudents = scalar keys %Grade; my @studentGrades = map { rand(100) } (1 .. $numberOfStudents); foreach my $student (keys %Grade){ %Grade{$student} = shift @studentGrades; } -Original Message- From: FLAHERTY, JIM-CONT

Re: Printing the number of times phone number appear in a textfile

2002-03-22 Thread John W. Krahn
Bruce Ambraal wrote: Hi all Hello, In the program below I am attempting to count the number of times that a phone number(purely digits) occurs in a file of text. I am not succeeding cause i end up counting all the digits of phone numbers that occurs. Could anyone help.

RE: usefulness of perl for production?

2002-03-22 Thread Auernheimer, Rebecca (CORP, Consultant)
I appreciate the replies so much. I start out with a command line like this: backup.bat mm dd yy where mm is the 2-digit month, dd is the 2-digit day, yy is the 2-digit year, and is the 4-digit year. Those are my variables, as I suppose they would be called. (Besides some programming

string question

2002-03-22 Thread Pedro A Reche Gallardo
Hi All, I was trying to generate variations of the 8 character string by changing every character with the elements containing in an array @aa = ('A', 'B', 'C', 'D'). The way I did it was quite naive, using a for loop that changes the A character at position 1 of the string by

Re: Comment reduire le temps de chargement d'un module ?

2002-03-22 Thread Peter Scott
At 04:50 PM 3/22/02 +0100, Patrice Boisieau wrote: Bonjour, Afin d'ameliorer le temps d'execution des scripts, je me demande s'il est possible de reduire le temps de chargement des modules a la phase de compilation. En particulier, est-ce que le temps de chargement est reduit dans le cas ou un

Re: Exhaustive graph of subroutines

2002-03-22 Thread Peter Scott
At 04:43 PM 3/22/02 +0100, Patrice Boisieau wrote: Hello Does it exist a CPAN module that computes the exhaustive graph of the subroutines of a script ? It is not possible in general to tell such things from a Perl program because it could always call a subroutine that is generated at

Re: Exhaustive graph of subroutines

2002-03-22 Thread Peter Scott
At 12:01 PM 3/22/02 -0800, I wrote: At 04:43 PM 3/22/02 +0100, Patrice Boisieau wrote: Hello Does it exist a CPAN module that computes the exhaustive graph of the subroutines of a script ? It is not possible in general to tell such things from a Perl program because it could always call a

RE: usefulness of perl for production?

2002-03-22 Thread Timothy Johnson
I'm on my day off, so I can't test this, but it should get you started. use File::Copy; #Get the date variables based on system time ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @months = qw(00NUL 01JAN 02FEB 03MAR 04APR 05MAY 06JUN

my first regex i think

2002-03-22 Thread Matthew Harrison
if i have a file delimited by commas and i want to make a script that will search to see if a word, passed in a query string, is in the file, and redirect to one url if i does and one if it doesn't (both urls are also passed via query strings) thanks in advance -- Matthew Harrison

write variable's contents to file :WAS: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list

2002-03-22 Thread K Clark
my random mp3 script works with strict and warnings (yeah!). now, i want to do a second task with it, which is additionally write the data of $inc to a file, named mp3.inc. Here's what i have. i can't find the reference to doing this. even the correct perldoc pointer would be wonderful.

RE: write variable's contents to file :WAS: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list

2002-03-22 Thread Nikola Janceski
perldoc -f print print FILEHANDLE LIST; In your case: print MP3 $inc\n; # \n is a newline character -Original Message- From: K Clark [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: write variable's contents to file :WAS: how to

Re: string question

2002-03-22 Thread John W. Krahn
Pedro A Reche Gallardo wrote: Hi All, Hello, I was trying to generate variations of the 8 character string by changing every character with the elements containing in an array @aa = ('A', 'B', 'C', 'D'). The way I did it was quite naive, using a for loop that changes the A

re: callin subs

2002-03-22 Thread Matthew Harrison
is there something that says a variable doesn;t get passed when calling a sub in the same script? i am working on a web-based role-playing game and this is the script for inside the temple: #!/usr/bin/perl ##Modules## use CGI qw/:standard/; use CGI::Carp

Re: callin subs

2002-03-22 Thread Matthew Harrison
all sorted now, thanks to you experts. it was because I have prefixed my variables with 'my' which restricted them. On Friday 22 Mar 2002 3:34 pm, Matthew Harrison wrote: is there something that says a variable doesn;t get passed when calling a sub in the same script? i am working on a

Re: Random sampling in perl

2002-03-22 Thread Balint, Jess
Thanks for the input. The only trouble I would have with that is the file size. My files are HUGE. I don't think the admins around here would like me doing that. What I was thinking was to generate an array with a bunch of random numbers in numerical order. Then run through the file and print

RE: Random sampling in perl

2002-03-22 Thread Wagner-David
If the code then change if( $i = $array[$j] ) to if( $i == $array[$j] ) otherwise you end assigning $i with the value of $array[$i]. Wags ;) -Original Message- From: Balint, Jess [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 13:04 To: '[EMAIL PROTECTED]' Subject: Re:

RE: Random sampling in perl

2002-03-22 Thread Balint, Jess
I just typed the code in the e-mail. It was part of my program. Sorry. -Original Message- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 4:16 PM To: 'Balint, Jess'; '[EMAIL PROTECTED]' Subject: RE: Random sampling in perl If the code then change if(

RE: my first regex i think

2002-03-22 Thread Balint, Jess
If you want to search line by line, use this: while( CSVFILE ) { if( /searchword/ ) { # redirect to url } } # redirect to OTHER url This will go through the file, line by line and check for the word. If found you will need to add code to go to the URL you want.

Re: splitting the string.

2002-03-22 Thread Jim Conner
I know many have probably answered this but Im just going down my email list. Here is the answer: @asplit = split(//,$a); That should be it. - Jim At 22:41 03.20.2002 -0800, Raja Gopal wrote: Hello Perl Experts, I want to split the string $a =abcdef; as @asplit = (a,b,c,d,e,f). Is

forking unix sockets

2002-03-22 Thread Ross Simpson
I'm trying to build a forking server which uses unix domain sockets for communication (on solaris 7). I've run into a problem where once a connection has been established and serviced by a child, my domain socket won't accept any more incoming connections. I modified my code so it doesn't fork

Re: write variable's contents to file :WAS: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list

2002-03-22 Thread John W. Krahn
K Clark wrote: my random mp3 script works with strict and warnings (yeah!). now, i want to do a second task with it, which is additionally write the data of $inc to a file, named mp3.inc. Here's what i have. i can't find the reference to doing this. even the correct perldoc pointer would be

Re: my first regex i think

2002-03-22 Thread Michael Kelly
Oops, I didn't realize this was cross-posted, and replied to the first instance I saw (the beginner's CGI list). The Perl beginner's and Perl beginner's CGI lists are, for the most part, mutually exclusive. (Does it or does it not have to do with CGI?). Please don't cross post, people. I assure

RE: string question

2002-03-22 Thread Timothy Johnson
Try something like this: my $string = ; my @aa = qw(A C D E F G H I K L M N P Q R S T V W Y); foreach(@aa){ my $i; my @strArray = split //,$string; for($i = 0;defined $strArray[$i];$i++){ my $j; for($j = 0;defined $strArray[$j];$j++){ if($j == $i){

RE: string question

2002-03-22 Thread Timothy Johnson
Oh, hey, didn't see this response. Ignore mine. This is better. :) I really need to start using substr(). One question, though. Are there any caveats or down sides to using it? -Original Message- From: John W. Krahn To: [EMAIL PROTECTED] Sent: 3/22/02 12:46 PM Subject: Re: string

Re: Sort of Conceptual, Syntax, and modules related questions

2002-03-22 Thread Michael Fowler
I've removed [EMAIL PROTECTED] from the Cc: list. I don't see how any of this directly relates to CGI. Please avoid cross-posting unless relevant and absolutely necessary. On Sat, Mar 23, 2002 at 05:30:25AM +0800, Connie Chan wrote: 1. When I open a text file with *lines, however, I just

Regex or code sample to split a text line

2002-03-22 Thread Oliver Andrich
Hi, I am currently stuck with developing an elegant solution for splitting a long text line into an array of strings of the certain maximum length and it should be split at online at word bounderies. So, my criterias are max length (78 chars) and split at \b. Is there any standard routine to

RE: Regex or code sample to split a text line

2002-03-22 Thread Timothy Johnson
while($text =~ /(\b.{0,78}\b)/g){ push @array, $1; } -Original Message- From: Oliver Andrich To: [EMAIL PROTECTED] Sent: 3/22/02 2:46 PM Subject: Regex or code sample to split a text line Hi, I am currently stuck with developing an elegant solution for splitting a long text line

Re: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list]

2002-03-22 Thread Chris McAvoy
Check out page 219 of the Perl Cookbook... s(^.*/)() Chris - Original Message - From: K Clark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 8:14 AM Subject: RE: how to randomly choose mp3 from dir, print mp3_filename for e mailing to a list] Here's what i

Re: forking unix sockets

2002-03-22 Thread bob ackerman
'close $sock' in the child? Wouldn't that kill the socket for the parent. Then no more connections for parent. also, why 'fork' in the client? what's the point? On Friday, March 22, 2002, at 01:33 PM, Ross Simpson wrote: I'm trying to build a forking server which uses unix domain sockets

joining 2 strings

2002-03-22 Thread Matthew Harrison
i need to join $stringa to $stringb with a coma in the middle (no whitespaces). i have tried $stringc = $stringa.,.$stringb but it says there is a problem. what should it be? -- Matthew Harrison Internet/Network Services Administrator Peanut-Butter Cheesecake Hosting Services Genstate

Re: joining 2 strings

2002-03-22 Thread bob ackerman
what did it say the problem was? that line is missing a semicolon at end. On Friday, March 22, 2002, at 03:40 PM, Matthew Harrison wrote: i need to join $stringa to $stringb with a coma in the middle (no whitespaces). i have tried $stringc = $stringa.,.$stringb but it says there is a

Re: joining 2 strings

2002-03-22 Thread Matthew Harrison
it said scalar found where operator expected. On Friday 22 Mar 2002 11:44 pm, bob ackerman wrote: what did it say the problem was? that line is missing a semicolon at end. On Friday, March 22, 2002, at 03:40 PM, Matthew Harrison wrote: i need to join $stringa to $stringb with a coma in

Re: joining 2 strings

2002-03-22 Thread bob ackerman
did it say the error was on the line you are showing below, or on the next line? i am getting at asking if you really end the line with semicolon or not. On Friday, March 22, 2002, at 03:46 PM, Matthew Harrison wrote: it said scalar found where operator expected. On Friday 22 Mar 2002

Re: joining 2 strings

2002-03-22 Thread Matthew Harrison
the semicolon was in my script i jsut forgot to put in in my email. sorry. On Friday 22 Mar 2002 11:51 pm, bob ackerman wrote: did it say the error was on the line you are showing below, or on the next line? i am getting at asking if you really end the line with semicolon or not. On Friday,

RE: joining 2 strings

2002-03-22 Thread Crook, Richard W
This program worked for me: #!/usr/bin/perl $stringa = apple; $stringb = banana; $stringc = $stringa . , . $stringb; print $stringc\n; -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: joining 2

RE: joining 2 strings

2002-03-22 Thread Jon Riddle
What I am seeing is that you are using the double quote and it should be single quotes -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: joining 2 strings i need to join $stringa to $stringb with a

Re: joining 2 strings

2002-03-22 Thread bob ackerman
maybe you could show what is in $stringa and $stringb. show a few lines before and after the line with the error. there isn't anything wrong with the line as it is here. On Friday, March 22, 2002, at 03:51 PM, Matthew Harrison wrote: the semicolon was in my script i jsut forgot to put in in

Re: joining 2 strings

2002-03-22 Thread bob ackerman
what difference would that make? double quotes would only try and do variable substitution. It wouldn't do anything with a comma. On Friday, March 22, 2002, at 03:50 PM, Jon Riddle wrote: What I am seeing is that you are using the double quote and it should be single quotes -Original

Re: joining 2 strings

2002-03-22 Thread Michael Fowler
On Fri, Mar 22, 2002 at 11:40:26PM +, Matthew Harrison wrote: $stringc = $stringa.,.$stringb but it says there is a problem. what should it be? That's one way of doing it. What does it say the problem is? Michael -- Administrator www.shoebox.net Programmer,

Re: joining 2 strings

2002-03-22 Thread Matthew Harrison
the script is part of a web-based role-playing-game. the line in question is in the sub called 'add': #!/usr/bin/perl ###Vars and modules### use CGI qw/:standard/; use CGI::Carp fatalsToBrowser; use DBI; $action = param('action'); $word = param('word'); $rd1 = param('rd1'); $rd2 =

Re: joining 2 strings

2002-03-22 Thread K Clark
would someone tell me whether or not the problem with what the original post is because of $stringa.,.$stringb being unbroken? does that matter? as a fledgling, i always pump alot of space in my scripts, but see some of the more advanced replies here being different... ken On Fri, Mar 22,

Re: joining 2 strings

2002-03-22 Thread bob ackerman
no. extra white space is ignored. works fine. note the original that failed did end with a semicolon. On Friday, March 22, 2002, at 04:01 PM, K Clark wrote: would someone tell me whether or not the problem with what the original post is because of $stringa.,.$stringb being unbroken? does

RE: joining 2 strings

2002-03-22 Thread Crook, Richard W
Looks like eiter $record or $word is a scalar where perl is looking for an operand. try: die $record; or die $word to see what the data is. You can only use the . to concatenate strings. -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22,

RE: joining 2 strings

2002-03-22 Thread Crook, Richard W
This may not be it but did you check the database to see what info is being passed to $record = $results[0]; or you can check the HTML page that $word = param(word); gets its info from? -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 4:00

Re: joining 2 strings

2002-03-22 Thread Matthew Harrison
after all this, it was a simple typo, i had accidentally put a comma in the place of the first period. I am really, really sorry for messing you guys about like this. On Friday 22 Mar 2002 11:59 pm, you wrote: On Fri, Mar 22, 2002 at 11:40:26PM +, Matthew Harrison wrote: $stringc =

Re: joining 2 strings

2002-03-22 Thread John W. Krahn
Matthew Harrison wrote: it said scalar found where operator expected. perldoc perldiag [snip] %s found where operator expected (S) The Perl lexer knows whether to expect a term or an operator. If it sees what it knows to be a term when it was

RE: joining 2 strings

2002-03-22 Thread Crook, Richard W
Heh heh! That's OK. Just buy us all a round at some pub when we go across the pond! -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 4:34 PM To: Michael Fowler Cc: [EMAIL PROTECTED] Subject: Re: joining 2 strings after all this, it was a

Re: joining 2 strings

2002-03-22 Thread Matthew Harrison
sure On Saturday 23 Mar 2002 12:37 am, you wrote: Heh heh! That's OK. Just buy us all a round at some pub when we go across the pond! -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 4:34 PM To: Michael Fowler Cc: [EMAIL PROTECTED]

RE: joining 2 strings

2002-03-22 Thread Timothy Johnson
Does it have the same error if you change the line to this? $newrec = $record,$word; -Original Message- From: Matthew Harrison To: bob ackerman Cc: [EMAIL PROTECTED] Sent: 3/22/02 3:59 PM Subject: Re: joining 2 strings the script is part of a web-based role-playing-game. the line in

Re: joining 2 strings

2002-03-22 Thread John W. Krahn
Matthew Harrison wrote: i need to join $stringa to $stringb with a coma in the middle (no whitespaces). i have tried $ perl -le' $one = one; $two = two; print $one . , . $two; print $one,$two; print join ,, $one, $two; ' one,two one,two one,two John -- use Perl; program fulfillment --

Sort of Conceptual, Syntax, and modules related questions

2002-03-22 Thread Connie Chan
Dear All, I have sort of questions, would you please give me some hint, even refering me to a perldoc would be nice too. 1. When I open a text file with *lines, however, I just want to read the first line, would this be a good idea ? open (FILE, textfile.txt); $firstline = FILE; close

RE: Sort of Conceptual, Syntax, and modules related questions

2002-03-22 Thread Timothy Johnson
1. It will only read the first line. The time you want to be careful with is when you are assigning it to a list. For example, @myarray = INFILE; will assign the entire contents of the file, while $myscalar = INFILE; will assign only the first line. 2. In Windows, the endline character is

RE: Sort of Conceptual, Syntax, and modules related questions

2002-03-22 Thread Timothy Johnson
Oops! The exclamation point in number 7 was a typo. -Original Message- From: Timothy Johnson To: 'Connie Chan '; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 3/22/02 1:59 PM Subject: RE: Sort of Conceptual, Syntax, and modules related questions 1. It will only read the first line.