Re: Thumbnail images on-the-fly
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Scott R. Godin) wrote: Many thanks to all of you who responded. :-) One of the things I love the most about these lists -- that one can get so many different perspectives on a problem and solution, because it gives one so much more of an idea of the scope of it. print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to set the env var?
Read 'perldoc DBI' As a convenience, if the $data_source parameter is undefined or empty the DBI will substitute the value of the environment variable DBI_DSN. If just the driver_name part is empty (i.e., data_source prefix is 'dbi::') the environment variable DBI_DRIVER is used. my ($username, $password) = ('foo', 'bar'); my $data_source = DBI:mysql:database=some_database;host=localhost; and: $dbh = DBI-connect($data_source, $username, $password) || die $DBI::errstr; or $dbh = DBI-connect($data_source, $username, $password, \%attr) || die $DBI::errstr; /Jon yun yun wrote: I programmed a .pl use DBI, but it says that Can't connect(DBI::Access::db1 HASH(0x1aff0bc)), no database driver specified and DBI_DSN env var not set at edit3.pl line 10 How should I set the DBI_DSB env var? _ Do You Yahoo!? µÇ¼Ãâ·ÑÑÅ»¢µçÓÊ! http://mail.yahoo.com.cn font color=#FFÎÞÁÄ£¿ÓôÃÆ£¿¸ßÐË£¿Ã»ÀíÓÉ£¿¶¼À´ÁÄÌì°É£¡/font¡ª¡ª ÑÅ»¢È«ÐÂÁÄÌìÊÒ! http://cn.chat.yahoo.com/c/roomlist.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DBD_ACCESS
I want to do a small test on database in perl using MS Access database, but I find there is no DBD_ACCESS in the DBI.pm, should I download it from somewhere? the same thing with the database DB2 and other database. Thanks! _ Do You Yahoo!? µÇ¼Ãâ·ÑÑÅ»¢µçÓÊ! http://mail.yahoo.com.cn font color=#FFÎÞÁÄ£¿ÓôÃÆ£¿¸ßÐË£¿Ã»ÀíÓÉ£¿¶¼À´ÁÄÌì°É£¡/font¡ª¡ª ÑÅ»¢È«ÐÂÁÄÌìÊÒ! http://cn.chat.yahoo.com/c/roomlist.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Regex Assistance
Thanks. That did the trick. Much appreciated. John -Original Message- From: Joshua Colson [mailto:[EMAIL PROTECTED]] Sent: 17 January 2002 17:58 To: '[EMAIL PROTECTED]' Subject: RE: Regex Assistance I've commented out two lines in your code and replaced them with mine. I think it should work, but let us know if it doesn't. Good Luck! Joshua Colson Systems Administrator Giant Industries, Inc. (480) 585-8714 [EMAIL PROTECTED] -Original Message- From: John Edwards [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 10:43 AM To: Perl Beginners (E-mail) Subject: Regex Assistance Hi group. I have the following snippet of code. It's not working and I've been going round in circles trying to figure out why. I need a routine that will look at the filename, if that filename already exists, then add a (1) to the end. I've got the checking for existance sorted, it's the generation of the new file name that is the issue. E.g. test.txt exists so create test(1).txt If test(1).txt exists then create test(2).txt and so on Here is the problematic code I have so far -- code -- my ($name, $ext) = split(/\./,$fileoutname); #if ($name =~ /\((\d{1,1})\)$/) { # Looks for (1) on the end for example if ($name =~ /\((\d)\)$/) { # the \d assumes one character. {1,1} is just to specify range. my $number = $1; $number++; # $name =~ tr/\(\d\)/\($number\)/; $name =~ s/\(\d\)$/\($number\)/;# this line should do the trick. } else { $name .= (1); } $fileoutname = $name\.$ext; -- end code -- There's probally some really basic errors in there, and maybe a much better way of doing it... TIA John --Confidentiality--. This E-mail is confidential. It should not be read, copied, disclosed or used by any person other than the intended recipient. Unauthorised use, disclosure or copying by whatever medium is strictly prohibited and may be unlawful. If you have received this E-mail in error please contact the sender immediately and delete the E-mail from your system. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re:How to make it more perlish
Hi, I have this piece of code and i wanted to simplify it and make it more perlish. thanks cbkRedrawLink() sub cbkRedrawLink() { my $PROG=c:\\OXE\\cygwin\\bootp\\linux\\$_Globals{LX_VERSION}; my $PROG2=c:\\OXE\\cygwin\\bootp\\linux\\install; my $PROG3=c:\\OXE\\cygwin\\bootp\\linux\\linux.ram; my $PROG4=c:\\OXE\\cygwin\\bootp\\linux\\alize\\install; my $PROG5=c:\\OXE\\cygwin\\bootp\\linux\\alize\\startup.txt; my $link=c:\\OXE\\cygwin\\bin\\ln.exe -s $_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Globals{LX_VERSION} $PROG; my $link2=c:\\OXE\\cygwin\\bin\\ln.exe -s $_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Globals{LX_VERSION}/install $PROG2; my $link3=c:\\OXE\\cygwin\\bin\\ln.exe -s $_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Globals{LX_VERSION}/linux.ram $PROG3 ; my $link4=c:\\OXE\\cygwin\\bin\\ln.exe -s $_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Globals{LX_VERSION}/install $PROG4; my $link5=c:\\OXE\\cygwin\\bin\\cp.exe -s $_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Globals{LX_VERSION}/alize/startup.txt $PROG5 ; unless (-e $PROG) { system($link) ; } unless (-e $PROG2) { system($link2) ; } unless (-e $PROG3) { system($link3) ; } unless (-e $PROG4) { system($link4) ; } unless (-e $PROG5) { system($link5) ; } } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DBD_ACCESS
=?Gb2312?Q?Yun=20yun?= wrote: I want to do a small test on database in perl using MS Access database, but I find there is no DBD_ACCESS in the DBI.pm, should I download it from somewhere? the same thing with the database DB2 and other database. Thanks! To use DBI with MS Access databases, you must use DBD::ODBC. You can also use Win32::ODBC if you want to access(!) Access-specific meta datas. http://search.cpan.org/search?dist=DBD-ODBC http://search.cpan.org/doc/GSAR/libwin32-0.18/ODBC/ODBC.pm -- briac dynamic .sig on strike, we apologize for the inconvenience -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make it more perlish
On Fri, Jan 18, 2002 at 11:39:11AM +0100, Jorge wrote: Hi, I have this piece of code and i wanted to simplify it and make it more perlish. thanks Ok, Howabout? Use an array for the items. Making the code more scalable by replacing each call with a loop? my @PROG=( c:\\OXE\\cygwin\\bootp\\linux\\$_Globals{LX_VERSION}, 'c:\\OXE\\cygwin\\bootp\\linux\\install', 'etc...'); my @LINK=qw(the same idea); for (0..$#PROG){ system ($LINK[$_]) unless -e $PROG[$_] } -- Frank Booth - Consultant Parasol Solutions Limited. (www.parasolsolutions.com) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to make it more perlish
In article [EMAIL PROTECTED], Frank wrote: On Fri, Jan 18, 2002 at 11:39:11AM +0100, Jorge wrote: my @PROG=( c:\\OXE\\cygwin\\bootp\\linux\\$_Globals{LX_VERSION}, 'c:\\OXE\\cygwin\\bootp\\linux\\install', 'etc...'); If you want to be a little more perlish, you can avoid the '\\' and put '/' instead, perl will do what you mean, and it's good for your laziness, too. -- briac dynamic .sig on strike, we apologize for the inconvenience -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using the system function
I am trying to scp a file to various systems, but the script hangs if the scp command to one of the systems fails. Is there a way in perl to specify that if the scp command doesn't work to skip it and continue with the next system? I have the following: : : use Net::Ping; @systems = qw(system1 system2 system3); foreach $system (@systems) { $p = Net::Ping-new(icmp); next unless $p-ping($system); system(/usr/local/bin/scp file $system:/home); $p-close(); } This works if the system is not reachable. But if the system is reachable but it is hung for some other reason, the script tries to do the scp command which it won't work. So the script does not continue. Any ideas on this would be greatly appreciated. Thanks. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
help with the backtick operator
I'm trying to call egrep from a perl script using the backtick operator -- I need to parse the output from egrep to see if additional information is contained, something like: $parseFile = `egrep -d skip \\form\s*.*?action\s*=\s*\?someFile.html 2/dev/null` if ($parseFile =~ /method\s*=\s*\?post/ ) { do this; } (I realize I could probably write a comprehensive regular expression, but I have other reasons for doing this...) Basically, I have the following question(s) about the backtick operators: In a scalar string context, will a shell command called by the backtick operator return ALL lines? i.e., if egrep returns multiple lines, will $parseFile contain all the lines? I know that in a list context, each item in the list will contain a single line -- but can it work this way as well? Thanks, Matthew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cgi on IIS
I hope someone can help me out. I set up this cgi file and html form on a Unix server. The script changes a user's password in a text file. This works correctly on a Unix Server. However, I need to move these files to an IIS server. In testing on the IIS server, I get an HTTP Error 405- Method not allowed when the form is submitted. I did some research, but was unable to determine how to correct the error. If anyone could help me out, I'd really appreciate it. Thanks, Maureen #!/usr/bin/perl require cgi-lib.pl; #process incoming form data ReadParse; #set content type print PrintHeader; #initialize variables $pwfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwdata.txt; $tmpfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwdata.tmp; $lokfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwlock.fil; #Print initial tags for web page print HTMLBODY\n; #check for existence of password file unless (-e $pwfile) { #password file doesn't exist! #print message shut down print PrintTag; H1Sorry!/H1 P$pwfile has't been uploaded to the proper directory. Please contact the webmaster./P /BODY /HTML PrintTag exit(0); } #check for blank form fields if ($in{'oldname'}eq || $in{'oldpw'}eq) { #re-create form and shut down program print PrintTag; PBERROR:/B Please type your current username and password in the spaces provided./P FORM ACTION=http://server37.hypermart.net/worldwidewebstrategies/cgi-bin/changepw.cgi; METHOD=post PYour current username:BR INPUT TYPE=text NAME=oldname VALUE=$in{'oldname'}/P PYour current password:BR INPUT TYPE=textNAME=oldpw VALUE=$in{'oldpw'}/P PYour new password:BR INPUT TYPE=text NAME=newpw1 VALUE=$in{'newpw1'}/P PType your new password again:BR INPUT TYPE=text NAME=newpw2 VALUE=$in{'newpw2'}/P P PrintTag if ($in{'delete'} eq yes) { print INPUT TYPE=\checkbox\ NAME=\delete\ VALUE=\yes\ CHECKED\n; } else { print \n; } print PrintTag; /P INPUT TYPE=submit VALUE=Change /FORM /BODY /HTML PrintTag exit(0); } #make sure new passwords match if ($in{'newpw1'} ne $in{'newpw2'}) { #re-create form and shut down program print PrintTag; PBERROR:/B Your new passwords didn't match. You must type your new password exactly the same way twice. Please try again./P FORM ACTION=http://server37.hypermart.net/worldwidewebstrategies/cgi-bin/changepw.cgi; METHOD=post PYour current username:BR INPUT TYPE=text NAME=oldname VALUE=$in{'oldname'}/P PYour current password:BR INPUT TYPE=text NAME=oldpw VALUE=$in{'oldpw'}/P PYour new password:BR INPUT TYPE=text NAME=newpw1/P PType your new password again:BR INPUT TYPE=text NAME=newpw2/P INPUT TYPE=submit VALUE=Change /FORM /BODY /HTML PrintTag exit(0); } #check for existence of lock file if (-e $lokfile) { #lock file exists! print message shut down print PrintTag; H1Try again!/H1 PThe database is in use. Please try again later./P /BODY /HTML PrintTag exit(0); } #everything is okay. Create lock file. open(LOCK_FILE, $lokfile) || die Couldn't create $lokfile\n; #open password file in read-only mode open(FILE,$pwfile) || die Can't find $pwfile.\n; #store database contents in an array and close file @indata = FILE; close(FILE); #open temp file in overwrite mode open(TEMP,$tmpfile) || die Can't create $tmpfile.\n; #copy password file contents to temp file #use a foreach loop to process each record in the array foreach $i (@indata) { #remove hard return character from each record chomp($i); #split fields on pipe character #assign a variable name to each of the fields ($username,$password) = split(/\|/,$i); if ($username eq $in{'oldname'} $password eq $in{'oldpw'} $in{'delete'} ne yes) { print TEMP $in{'oldname'}|$in{'newpw1'}\n; print Ph1 Success!/h1Your password has been changed./P\n; } elsif ($username eq $in{'oldname'} $in{'delete'} eq yes) { print PYour password has been deleted./P\n; } else { print TEMP $i\n; } } #close temp file close(TEMP); #change file names rename($pwfile, $pwfile..old); rename($tmpfile, $pwfile); #close and delete lock file close(LOCK_FILE); unlink($lokfile); #close web page print PThank you! /P\n; print /BODY/HTML\n; #end of script -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using the system function
if you aren't interesed in weather it works or not, why not try system(/usr/local/bin/scp file $system:/home ); /jon lospalomares wrote: I am trying to scp a file to various systems, but the script hangs if the scp command to one of the systems fails. Is there a way in perl to specify that if the scp command doesn't work to skip it and continue with the next system? I have the following: : : use Net::Ping; @systems = qw(system1 system2 system3); foreach $system (@systems) { $p = Net::Ping-new(icmp); next unless $p-ping($system); system(/usr/local/bin/scp file $system:/home); $p-close(); } This works if the system is not reachable. But if the system is reachable but it is hung for some other reason, the script tries to do the scp command which it won't work. So the script does not continue. Any ideas on this would be greatly appreciated. Thanks. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
changing file attributes
I'm receiving several hundred data files from from several states via CD-ROM. When these files are copied to my hard drive or network storage, the read-only attribute remains on the file. What I would like to do is have Perl to remove the read-only attribute for all of the files that I put in a certain folder (e.g., L:\Flu\StData\). If there is a better way or another program to do this, can someone direct me to the appropriate tool? Thanks, --- Jeremy T. Miller Centers For Disease Control Atlanta, GA 30333 Ph: (404) 637-1883 Fax: (404) 637-8614 --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
module directory problem
Hi all, I have problem with directory environment. The scripts are on a NT system using Active Perl v5.6.1. I have one script at foo\test.pl and use package at tools\tools.pm I imported the tools.pm to test.pl during this # in test.pl script use lib '../tools'; use TOOLS; The tools.pm has the following: # in tools.pm package TOOLS; use Cwd; $dir = cwd(); ### get the path of the current directory print $dir\n; 1; The problem is that the value of $dir is foo\ and not tools\ even tools.pm in the tools\. This is a problem since I need to access files with data in tools\ from the tools.pm script. Are there anyway to solve the module import problem? Thanks =D __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PERLDB_OPTS
Hello beginners, How i can change environment variables (e.g. PERLDB_OPTS) to any values so they remained general(public) for all instances of perl scripts? $ENV{'PERLDB_OPTS'}=LocalPort; # working only for currently running script. Sincerely yours, Babichev Dmitry. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: module directory problem
-Original Message- From: Yeung Siu [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 5:48 PM To: [EMAIL PROTECTED] Subject: module directory problem Hi all, I have problem with directory environment. The scripts are on a NT system using Active Perl v5.6.1. I have one script at foo\test.pl and use package at tools\tools.pm I imported the tools.pm to test.pl during this # in test.pl script use lib '../tools'; use TOOLS; The tools.pm has the following: # in tools.pm package TOOLS; use Cwd; $dir = cwd(); ### get the path of the current directory print $dir\n; 1; The problem is that the value of $dir is foo\ and not tools\ even tools.pm in the tools\. This is a problem since I need to access files with data in tools\ from the tools.pm script. Are there anyway to solve the module import problem? Thanks =D Use the special literal __FILE__ to get the path to tools.pm This symbol is documented in perldoc perldata -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PERLDB_OPTS
-Original Message- From: Babichev Dmitry [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 01, 2001 8:35 AM To: [EMAIL PROTECTED] Subject: PERLDB_OPTS Hello beginners, How i can change environment variables (e.g. PERLDB_OPTS) to any values so they remained general(public) for all instances of perl scripts? $ENV{'PERLDB_OPTS'}=LocalPort; # working only for currently running script. Environments belong to *processes*, and a process cannot change the environment of another process, with one exception: when a new process is created with fork(), the child process is initialized with a copy of the environment of its parent. Typically you accomplish this kind of thing by setting the variable in some kind of shell initialization script like .profile which is read by your shell when it starts. Then when you start any program from your shell, that program will pick up the setting, since it's a child of the shell. That still doesn't take care of processes that aren't started by your shell (web servers, etc.). Those programs will have their own way of initializing their environment (e.g. Apache's httpd.conf file). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IPC
I was wondering if anyone could point me in the direction of a good perl ipc tutorial (other than perldoc). Also any perlscript sites or using c/c++ in perl would be appreciated too. Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PERLDB_OPTS
Hello beginners, How i can change environment variables (e.g. PERLDB_OPTS) to any values so they remained general(public) for all instances of perl scripts? BS Typically you accomplish this kind of thing by setting the variable in BS some kind of shell initialization script like .profile which is read BS by your shell when it starts. OK. Where i can find initialization script ? perl -v = ActiveState 5.6.1 os = WinNT4.0+Sp6 path to perl d:\Perl\bin\perl Sincerely yours, Babichev Dmitry. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help with the backtick operator
From: Matthew Weier O'Phinney [EMAIL PROTECTED] Basically, I have the following question(s) about the backtick operators: In a scalar string context, will a shell command called by the backtick operator return ALL lines? i.e., if egrep returns multiple lines, will $parseFile contain all the lines? I know that in a list context, each item in the list will contain a single line -- but can it work this way as well? The docs say : The collected standard output of the command is returned; standard error is unaffected. In scalar context, it comes back as a single (potentially multi-line) string, or undef if the command failed. In list context, returns a list of lines (however you've defined lines with $/ or $INPUT_RECORD_SEPARATOR), or an empty list if the command failed. I think that's clear :-) Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: changing file attributes
On 17 January 2002 19:34, Miller, Jeremy T. [mailto:[EMAIL PROTECTED]] wri=ote: What I would like to do is have Perl to remove the read-only attribute for all of the files that I put in a certain folder (e.g., L:\Flu\StData\). For once, don't use perl. cd L:\Flu\StData attrib/s -r *.* (The /s says do this and subdirectories.) If you really need to use perl, I would suggest working with File::Find. Richard Cox Senior Software Developer Dell Technology Online All opinions and statements mine and do not in any way (unless expressly stated) imply anything at all on behalf of my employer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing file attributes
Jeremy, You could try something like this: my $Attributes = 32; $path = L:\\Flu\\StData\\; foreach $e ( $path\\*.* ) { Win32::File::SetAttributes ($path, NORMAL); } From: Miller, Jeremy T. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: changing file attributes Date: Thu, 17 Jan 2002 14:33:45 -0500 I'm receiving several hundred data files from from several states via CD-ROM. When these files are copied to my hard drive or network storage, the read-only attribute remains on the file. What I would like to do is have Perl to remove the read-only attribute for all of the files that I put in a certain folder (e.g., L:\Flu\StData\). If there is a better way or another program to do this, can someone direct me to the appropriate tool? Thanks, --- Jeremy T. Miller Centers For Disease Control Atlanta, GA 30333 Ph: (404) 637-1883 Fax: (404) 637-8614 --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: IPC
-Original Message- From: Ryan Guy [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 9:20 AM To: '[EMAIL PROTECTED]' Subject: IPC I was wondering if anyone could point me in the direction of a good perl ipc tutorial (other than perldoc). Also any perlscript sites or using c/c++ in perl would be appreciated too. Thanks in advance. Perl Cookbook by Christiansen and Torkington has a bunch of nice IPC examples. If you want to get serious about the fundamentals of IPC, you can't beat Stevens' Unix Network Programming (2 vols). HTH -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
creating labels in MS ACCESS
Hello all, This might not be the right place for this question, but I trust this group. My boss wants me to create a mailing list from his MS ACCESS database. I am not an MS fun, but I cannot tell him this. So my question is how do I create labels from an ACCESS database. Thanks __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
inetd client server communications
I'm trying to make an inetd perl server to communicate with a perl client. Communication from client to server is working but not from server to client. As I understand inetd handles the socket, bind, listen and accept stuff and basically you can communicate between server and client using STDIN and STDOUT. But it's not working and I'm stuck. Does anyone know what I'm doing wrong/can help me going again? Thanks Henk This is what I've got sofar.: ==/etc/services== psad1200/tcp# Test perl inetd daemon ==/etc/inetd.conf psad stream tcpnowait root/tmp/server.prl ==server.prl #!/usr/bin/perl open (OUTFILE, /tmp/effe1); # Open output file select(OUTFILE); $|++; # Unbuffered output OUTFILE select(STDOUT); $|++; # Unbuffered output STDOUT while (STDIN) { print OUTFILE $_; # Write client lines to OUTFILE } print Output for standard out\n; # Send lind to client close (OUTFILE);# Close output file ==client.prl== #!/usr/bin/perl use IO::Socket; # Setup connection to server , for now on same host $sock = IO::Socket::INET-new( PeerAddr= 'localhost', PeerPort= 1200, Proto = 'tcp', ); unless ($sock) {die Socket could not be created, Reason: $!} foreach (1..100) { print $sock Line $_\n;# Send lines to server } # Hope to receive output from server and store in file open (OUTFILE, /tmp/effe2) || die can't open outfile $!; $a = STDIN; print OUTFILE $a; close (OUTFILE);# Close output file close ($sock); # Close connection _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
hashing - cannot remember how :(
Hi, This is DUMB, but I cannot remember how? I have two hashes and I want to pass them: $data{ week } = %week_day_date; $data{ eng } = %eng_info; build_table_date( 5, %data ); then: sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows *$data{ week }{ $rows }br; } But I get no data from $data{ week }{ $rows }! I know this is simple, but what am I doing wrong? Thanks for your help, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
hashing - cannot remember how :(
Hi, This is DUMB, but I cannot remember how? I have two hashes and I want to pass them: $data{ week } = %week_day_date; $data{ eng } = %eng_info; build_table_date( 5, %data ); then: sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows *$data{ week }{ $rows }br; } But I get no data from $data{ week }{ $rows }! I know this is simple, but what am I doing wrong? Thanks for your help, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hashing - cannot remember how :(
Try this. You didn't provide any sample data, so this is untested. $data{ week } = \%week_day_date; $data{ eng } = \%eng_info; build_table_date( 5, %data ); sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows $data{ week }{ $rows }br; } } -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 11:53 AM To: begginners Subject: hashing - cannot remember how :( Hi, This is DUMB, but I cannot remember how? I have two hashes and I want to pass them: $data{ week } = %week_day_date; $data{ eng } = %eng_info; build_table_date( 5, %data ); then: sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows *$data{ week }{ $rows }br; } But I get no data from $data{ week }{ $rows }! I know this is simple, but what am I doing wrong? Thanks for your help, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hashing - cannot remember how :(
-Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Try this. You didn't provide any sample data, so this is untested. $data{ week } = \%week_day_date; $data{ eng } = \%eng_info; build_table_date( 5, %data ); sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows $data{ week }{ $rows }br; I guess the expression should be $data{week}-{$rows} since it is a reference. Right? } } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hashing - cannot remember how :(
Robert, Sorry about the no data, but your code worked!! Thanks, Jerry Hanson, Robert wrote: Try this. You didn't provide any sample data, so this is untested. $data{ week } = \%week_day_date; $data{ eng } = \%eng_info; build_table_date( 5, %data ); sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows $data{ week }{ $rows }br; } } -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 11:53 AM To: begginners Subject: hashing - cannot remember how :( Hi, This is DUMB, but I cannot remember how? I have two hashes and I want to pass them: $data{ week } = %week_day_date; $data{ eng } = %eng_info; build_table_date( 5, %data ); then: sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows *$data{ week }{ $rows }br; } But I get no data from $data{ week }{ $rows }! I know this is simple, but what am I doing wrong? Thanks for your help, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hashing - cannot remember how :(
I guess the expression should be $data{week}-{$rows} since it is a reference. Right? I usually use the - operator so that it sticks out, but either should work. I don't think there is any performance benefit, so it is just a matter of preference. The same goes when dereferencing, %$data{week} is the equivelent of %{$data{week}}... and usually use the former. Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 12:00 PM To: [EMAIL PROTECTED] Cc: Hanson, Robert; [EMAIL PROTECTED] Subject: RE: hashing - cannot remember how :( -Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Try this. You didn't provide any sample data, so this is untested. $data{ week } = \%week_day_date; $data{ eng } = \%eng_info; build_table_date( 5, %data ); sub build_table_date { my( $rows, %data ) = @_; foreach $row ( 1..$rows ) { printrows $row $rows $data{ week }{ $rows }br; I guess the expression should be $data{week}-{$rows} since it is a reference. Right? } } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
regex issues
Folks, I have the following log line [GUARD] ux234870176451713.231.232.72CK IMP imp here is the regex I am attempting to use # $1 $2$3 $4$5 $6 elsif ( $line =~ /\[GUARD\] (.+)(\d+)(\d+)(.+) (.+) (.+)/) { print $line\n; print $1 $2 $3 $4 $5 $6\n; $name = $1; $name =~ s/\|/\@/g; $wonid = $3; $server = ; $cheat = $6 } and I get the following output. ux234 870 1764517 13.231.232.72CK IMP imp I am trying to capture the values between the 's as arguments, not sure why the output looks as it does. Ronald J. Yacketta Principal Consultant Ciber, INC 345 Woodcliff Dr. Fairport, NY 14450 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form to Flat File
On Thu, 17 Jan 2002 14:01:28 -0700, [EMAIL PROTECTED] (Aaron White) wrote: Does anyone have a simple script that can handle about ten fields from a basic html form, that can be written to a flat file. Here's a simple one that will save all params to a pipe=delimited fat-text file. zz.cgi # #!/usr/bin/perl -wT use CGI; use Fcntl qw/:flock/; my $query = CGI-new(); my @names = $query-param; open (DATA, mydata.txt) or die Sorry, can't open mydata.txt.\n; flock DATA, LOCK_EX or die Couldn't get filelock: $!\n; print DATA (localtime) [5,4,3,2,1,0],'-' ; foreach my $name (@names) { my @values = $query-param($name); print DATA $name . = . ( join , , @values ) . '|'; } print DATA \n; close (DATA); print $query-header(text/plain); print 'Thank You',\n; Here's a simple form for it ## html head titleSend us info.../title /head body font size=5Send us info/fontfont size=4br/font form action=cgi-bin/zz.cgi method=POST pfont size=4Your form1 (required):/fontbr input type=text name=form1 size=50/p pfont size=4Your form2 (required):/fontbr input type=text name=form2 size=50/p pfont size=4Your form3 (required):/fontbr input type=text name=form3 size=50/p pfont size=4Your form4 (required):/fontbr input type=text name=form4 size=50/p pfont size=4Your form5 (required):/fontbr input type=text name=form5 size=50/p pinput type=submit input type=reset value=Clear /p /form /body /html ## -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sample customer dbms in perl/mysql
Hello, I have just been asked to come up with Perl/Mysql demo on Monday. Considering the short notice, I was wondering if anyone can point me to a freeware WEB-base database system implemented in Perl and Mysql. Thank you. __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Net::FTP fails on filenames with spaces
Can someone help me, I need to retrieve files with spaces in them, and Net::FTP errors out everytime. I've tried embedding quotes, not storing name in variable, quoting/not quoting variables. I'm at a loss. I thought that maybe I could convert the spaces to something, much like a webserver converts spaces in a URL, but I don't know if a FTP server could handle that, or how to do it if it could. Any help would be great!! Thanks. Joshua Colson Systems Administrator Giant Industries, Inc. (480) 585-8714 [EMAIL PROTECTED]
Re: regex issues
Try: /\[GUARD\] ([^]+)(\d+)(\d+)([^]+) ([^]+) ({^]+)/ To limit the characters you were matching with '.' to anything but angle brackets or: /\[GUARD\] (.+?)(\d+?)(\d+?)(.+?) (.+?) (.+?)/ To cause the matching to be non-greedy and not swallow up the CK that it grabbed in your example. - Johnathan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: sample customer dbms in perl/mysql
If you just need to show them a pre-existing site that uses Perl and mySQL, SlashDot (www.slashdot.org) is a fine example. They have details of their setup posted at http://slashdot.org/faq/tech.shtml#te050 There are also lots of examples on the MySQL official website at www.mysql.com Chris Spurgeon Senior Design Technologist [EMAIL PROTECTED] ELECTRONIC INK One South Broad Street 19th Floor Philadelphia, PA 19107 www.electronicink.com t 215.922.3800 x(233) f 215.922.3880 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 3:41 PM To: [EMAIL PROTECTED] Subject: sample customer dbms in perl/mysql Hello, I have just been asked to come up with Perl/Mysql demo on Monday. Considering the short notice, I was wondering if anyone can point me to a freeware WEB-base database system implemented in Perl and Mysql. Thank you. __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail is intended solely for the above-mentioned recipient and it may contain confidential or privileged information. If you have received it in error, please notify us immediately and delete the e-mail. You must not copy, distribute, disclose or take any action in reliance on it. In addition, the contents of an attachment to this e-mail may contain software viruses which could damage your own computer system. While Electronic Ink, Inc. has taken every reasonable precaution to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should perform your own virus checks before opening the attachment. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules needed for Validation
You can use regular expressions to verify them. --- Connie Chan [EMAIL PROTECTED] wrote: Hi all, Is there any module can use to verify data type (String, Integer, floating, Hex, valid email address, valid url etc.) ? Thank you very much. = Yeung Siu [EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CGI-BIN Question
What do I need to do to run CGI Scripts on a NT box? Thank you Lance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CGI-BIN Question
A web server and a scripting language (I assume you were planning on using Perl). Some will suggest Apache (www.apache.org), and other will suggest IIS. Then you need ActiveState's ActivePerl (www.activestate.com), or some other Win32 port, Cygwin might work. Then you just need to set it up. I think the ActivePerl installation will automatically make the configuration changes in IIS if you already have it installed (but I'm not sure). If you choose Apache, you might want to get a book on it. Rob -Original Message- From: Lance Prais [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 7:14 PM To: PERL Subject: CGI-BIN Question What do I need to do to run CGI Scripts on a NT box? Thank you Lance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
array and hash assignment
hi, howto to proove that array and hash assignments are made by using cloning and not by reference in perl. I am a newbie at perl and have no idea howoto to do it. need help have a good day cheers, amrit. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Smart grep
Hello, Thank you John your code helps very well !!! Omar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: array and hash assignment
You want to see if a scalar is actually a scalar or a ref? Try this... if ( ref $var ) { # It's a reference! } else { # It's not a reference } Rob -Original Message- From: amrit kumar [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 6:14 PM To: [EMAIL PROTECTED] Subject: array and hash assignment hi, howto to proove that array and hash assignments are made by using cloning and not by reference in perl. I am a newbie at perl and have no idea howoto to do it. need help have a good day cheers, amrit. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: array and hash assignment
hi, what i want to proove is...supposer that i assign an array @a = (1,2); and then i define another array @b which is equal to @a.I have to proove that this is done by assigning a copy of array @a to @b rather than by reference. Can you help me do that...i am bit confused .. thanks a lot.. have a good day.. cheers, amrit. --- Hanson, Robert [EMAIL PROTECTED] wrote: You want to see if a scalar is actually a scalar or a ref? Try this... if ( ref $var ) { # It's a reference! } else { # It's not a reference } Rob -Original Message- From: amrit kumar [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 6:14 PM To: [EMAIL PROTECTED] Subject: array and hash assignment hi, howto to proove that array and hash assignments are made by using cloning and not by reference in perl. I am a newbie at perl and have no idea howoto to do it. need help have a good day cheers, amrit. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I cant run perl from the dos command line
I am running ActivePerl 5.61.629 on Windows 98. It worked fine until yesterday but now I can't run any scripts from the DOS command line. I have attempted to run the example.pl script C:Perl\egperl example.pl I get the error message. Bad command or file name However the CGI bin on my Xitami localhost is fine, Have you any ideas what the problem may be??? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: array and hash assignment
On Jan 18, amrit kumar said: what i want to proove is...supposer that i assign an array @a = (1,2); and then i define another array @b which is equal to @a.I have to proove that this is done by assigning a copy of array @a to @b rather than by reference. To determine if two variables point to the same data or to COPIES of the same data, see if MODIFYING one of the variables MODIFIES the other. -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for Regular Expressions in Perl published by Manning, in 2002 ** stu what does y/// stand for? tenderpuss why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: array and hash assignment
On Fri, 18 Jan 2002, [iso-8859-1] amrit kumar wrote: hi, what i want to proove is...supposer that i assign an array @a = (1,2); and then i define another array @b which is equal to @a.I have to proove that this is done by assigning a copy of array @a to @b rather than by reference. Can you help me do that...i am bit confused .. To use your example: my @a = (1, 2); my @b = @a; print a: @a\n; print b: @b\n; $b[1] = 'foo'; print a: @a\n; print b: @b\n; run those lines of code, and you will see that altering @b, doesn't alter @a. Christopher -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
object orientation in perl
hi, I am newbie at Perl. I have written the following code in perl :- sub point { # point(x,y) constructor my ($x, $y) = @_; return ( 'x' = $x, # components 'y' = $y, 'show' = sub { # display method my %p = @_; print point at $p{'x'},$p{'y'}\n; } ); } sub show { # method calling function my %shape = @_; $shape{'show'}(%shape); } show(point(1,2)); Is it anyway possible to Extend the above program with constructors for rectangle and circle and a non-virtual function move to change the reference point of any of these objects. Can anybody help me out with it :- peace __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pattern Matching - Remove Alpha
On Wed, Jan 16, 2002 at 09:51:45PM -0500, Tanton Gibbs wrote: Michael brings up a good point...for this problem, you would probably be better served by tr $stat =~ tr/a-zA-Z//d; will delete any alpha character. Although split will do the job, I think tr would be a more idiomatic choice, probably more efficient too. That might work, except one of his requirements is that the numeric data be placed into an array. tr/// is more efficient; I can't really guage its level of idiomicity compared to split. On Wed, Jan 16, 2002 at 05:38:56PM -0600, Hewlett Pickens wrote: [snip] $stat is a string that has alpha and numeric data in it. I want to remove all of the alpha and put the numeric data into an array. [snip] Michael Fun with Language Fowler -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I cant run perl from the dos command line
Path in your autoexec.bat file? Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: rabs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 18, 2002 3:32 PM Subject: I cant run perl from the dos command line I am running ActivePerl 5.61.629 on Windows 98. It worked fine until yesterday but now I can't run any scripts from the DOS command line. I have attempted to run the example.pl script C:Perl\egperl example.pl I get the error message. Bad command or file name However the CGI bin on my Xitami localhost is fine, Have you any ideas what the problem may be??? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cgi on IIS
Maybe the file name has a .cgi extension? .cgi is not set for exeeute by default. Try renaming it .pl assuming you installed ActivePerl. Or in Internet Services Manager right click the scripts folder, and take a look at the instructions in the attached mail of few days ago. I'm figuring that'll probably do it. Note that last time I installed ActivePerl it set .pl to perl %s %s as I recall, but the extra double quotes may not matter, or maybe would apply if your path/to/script had a space in it. /g -Original Message- From: maureen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 1:19 PM To: Beginners CGI List; [EMAIL PROTECTED] Subject: Cgi on IIS I hope someone can help me out. I set up this cgi file and html form on a Unix server. The script changes a user's password in a text file. This works correctly on a Unix Server. However, I need to move these files to an IIS server. In testing on the IIS server, I get an HTTP Error 405- Method not allowed when the form is submitted. I did some research, but was unable to determine how to correct the error. If anyone could help me out, I'd really appreciate it. Thanks, Maureen #!/usr/bin/perl require cgi-lib.pl; #process incoming form data ReadParse; #set content type print PrintHeader; #initialize variables $pwfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwdata.txt; $tmpfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwdata.tmp; $lokfile = /data1/hypermart.net/worldwidewebstrategies/datafile/pwlock.fil; #Print initial tags for web page print HTMLBODY\n; #check for existence of password file unless (-e $pwfile) { #password file doesn't exist! #print message shut down print PrintTag; H1Sorry!/H1 P$pwfile has't been uploaded to the proper directory. Please contact the webmaster./P /BODY /HTML PrintTag exit(0); } #check for blank form fields if ($in{'oldname'}eq || $in{'oldpw'}eq) { #re-create form and shut down program print PrintTag; PBERROR:/B Please type your current username and password in the spaces provided./P FORM ACTION=http://server37.hypermart.net/worldwidewebstrategies/cgi-bin/ changepw.cgi METHOD=post PYour current username:BR INPUT TYPE=text NAME=oldname VALUE=$in{'oldname'}/P PYour current password:BR INPUT TYPE=textNAME=oldpw VALUE=$in{'oldpw'}/P PYour new password:BR INPUT TYPE=text NAME=newpw1 VALUE=$in{'newpw1'}/P PType your new password again:BR INPUT TYPE=text NAME=newpw2 VALUE=$in{'newpw2'}/P P PrintTag if ($in{'delete'} eq yes) { print INPUT TYPE=\checkbox\ NAME=\delete\ VALUE=\yes\ CHECKED\n; } else { print \n; } print PrintTag; /P INPUT TYPE=submit VALUE=Change /FORM /BODY /HTML PrintTag exit(0); } #make sure new passwords match if ($in{'newpw1'} ne $in{'newpw2'}) { #re-create form and shut down program print PrintTag; PBERROR:/B Your new passwords didn't match. You must type your new password exactly the same way twice. Please try again./P FORM ACTION=http://server37.hypermart.net/worldwidewebstrategies/cgi-bin/ changepw.cgi METHOD=post PYour current username:BR INPUT TYPE=text NAME=oldname VALUE=$in{'oldname'}/P PYour current password:BR INPUT TYPE=text NAME=oldpw VALUE=$in{'oldpw'}/P PYour new password:BR INPUT TYPE=text NAME=newpw1/P PType your new password again:BR INPUT TYPE=text NAME=newpw2/P INPUT TYPE=submit VALUE=Change /FORM /BODY /HTML PrintTag exit(0); } #check for existence of lock file if (-e $lokfile) { #lock file exists! print message shut down print PrintTag; H1Try again!/H1 PThe database is in use. Please try again later./P /BODY /HTML PrintTag exit(0); } #everything is okay. Create lock file. open(LOCK_FILE, $lokfile) || die Couldn't create $lokfile\n; #open password file in read-only mode open(FILE,$pwfile) || die Can't find $pwfile.\n; #store database contents in an array and close file @indata = FILE; close(FILE); #open temp file in overwrite mode open(TEMP,$tmpfile) || die Can't create $tmpfile.\n; #copy password file contents to temp file #use a foreach loop to process each record in the array foreach $i (@indata) { #remove hard return character from each record chomp($i); #split fields on pipe character #assign a variable name to each of the fields ($username,$password) = split(/\|/,$i); if ($username eq $in{'oldname'} $password eq $in{'oldpw'} $in{'delete'} ne yes) { print TEMP $in{'oldname'}|$in{'newpw1'}\n; print Ph1 Success!/h1Your password has been changed./P\n; } elsif ($username eq $in{'oldname'} $in{'delete'} eq yes) { print PYour password has been deleted./P\n; } else { print TEMP $i\n; } } #close temp file close(TEMP); #change file names rename($pwfile, $pwfile..old); rename($tmpfile, $pwfile); #close and delete lock file close(LOCK_FILE); unlink($lokfile); #close web page print PThank you! /P\n; print /BODY/HTML\n; #end of script -- To unsubscribe, e-mail: [EMAIL
object orientation :- please help
hi, I am newbie at Perl. I have written the following code in perl :- sub point { # point(x,y) constructor my ($x, $y) = @_; return ( 'x' = $x, # components 'y' = $y, 'show' = sub { # display method my %p = @_; print point at $p{'x'},$p{'y'}\n; } ); } sub show { # method calling function my %shape = @_; $shape{'show'}(%shape); } show(point(1,2)); Is it anyway possible to Extend the above program with constructors for rectangle and circle and a non-virtual function move to change the reference point of any of these objects. Can anybody help me with it.. it would be great... have a good day... cheers, amrit. __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]