[25689] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7930 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 1 03:05:37 2005

Date: Fri, 1 Apr 2005 00:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 1 Apr 2005     Volume: 10 Number: 7930

Today's topics:
        CD-R or CD-RW ? (kielhd)
        Database -> Excel <sigzero@gmail.com>
    Re: Database -> Excel <1usa@llenroc.ude.invalid>
    Re: Database -> Excel sigzero@gmail.com
    Re: Database -> Excel <someone@example.com>
    Re: Database -> Excel <1usa@llenroc.ude.invalid>
    Re: Database -> Excel <me@somewhere.com>
    Re: Getting Perl to ignore Letters when calculating num <tadmc@augustmail.com>
    Re: Information transfer over the internet <see_sig@invalid>
    Re: Performance question robic0@yahoo.com
    Re: Pulling hair out with pattern matching robic0@yahoo.com
    Re: Pulling hair out with pattern matching robic0@yahoo.com
    Re: Redirect on the NO pushing button <tadmc@augustmail.com>
    Re: Redirect on the NO pushing button axel@white-eagle.invalid.uk
        Unable to connect to remote host srithota@gmail.com
    Re: Using a for() statement to create a variable?? robic0@yahoo.com
    Re: Using a for() statement to create a variable?? robic0@yahoo.com
    Re: using Perl to insert footer into PDF files? robic0@yahoo.com
    Re: Why doesn't Perl have cp or mv? robic0@yahoo.com
    Re: YARQ - Yet another regex question robic0@yahoo.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 31 Mar 2005 21:57:05 -0800
From: kielhd@freenet.de (kielhd)
Subject: CD-R or CD-RW ?
Message-Id: <10a4173d.0503312157.5ea305ee@posting.google.com>

Hi NG,

is there a way for Perl to find out, if a CD is a CD-R or a CD-RW?

TIA,
Henning


------------------------------

Date: Thu, 31 Mar 2005 22:41:14 -0500
From: Robert <sigzero@gmail.com>
Subject: Database -> Excel
Message-Id: <sigzero-06C786.22411331032005@news.isp.giganews.com>

I see a whole passle of Excel modules on CPAN. I am querying an Oracle 
database and I want to save that query into an Excel file. What module 
would you suggest that I use?

Robert


------------------------------

Date: Fri, 01 Apr 2005 05:45:35 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Database -> Excel
Message-Id: <Xns962B7BA64A3Dasu1cornelledu@127.0.0.1>

Robert <sigzero@gmail.com> wrote in news:sigzero-06C786.22411331032005
@news.isp.giganews.com:

> I see a whole passle of Excel modules on CPAN. 

What exactly is a "passle"?

> I am querying an Oracle database and I want to save that query 
> into an Excel file. What module would you suggest that I use?

If all you need is to save some tables in a format that can be viewed 
using Excel, generating CSV files should fit the bill. See Text::CSV_XS.

If you want to generate native Excel binary files, 

if you are on Windows, you can use the facilities provided by 
Win32::OLE.

I have no experience with it, but you can also use 

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.12/

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: 31 Mar 2005 22:01:19 -0800
From: sigzero@gmail.com
Subject: Re: Database -> Excel
Message-Id: <1112335279.088096.207440@f14g2000cwb.googlegroups.com>


A. Sinan Unur wrote:
> Robert <sigzero@gmail.com> wrote in
news:sigzero-06C786.22411331032005
> @news.isp.giganews.com:
>
> > I see a whole passle of Excel modules on CPAN.
>
> What exactly is a "passle"?
>

Well I did spell it wrong. It should be "passel".

A large quantity or group: "The President faces a passel of domestic
issues"

http://dictionary.reference.com/search?r=2&q=passel

Robert



------------------------------

Date: Fri, 01 Apr 2005 06:05:10 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Database -> Excel
Message-Id: <qw53e.142720$gJ3.140027@clgrps13>

A. Sinan Unur wrote:
> Robert <sigzero@gmail.com> wrote in news:sigzero-06C786.22411331032005
> @news.isp.giganews.com:
> 
>>I see a whole passle of Excel modules on CPAN. 
> 
> What exactly is a "passle"?

You'll have to watch an old John Wayne movie to find out.  :-)


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Fri, 01 Apr 2005 06:08:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Database -> Excel
Message-Id: <Xns962BBA39D193asu1cornelledu@127.0.0.1>

"John W. Krahn" <someone@example.com> wrote in news:qw53e.142720
$gJ3.140027@clgrps13:

> A. Sinan Unur wrote:
>> Robert <sigzero@gmail.com> wrote in news:sigzero-06C786.22411331032005
>> @news.isp.giganews.com:
>> 
>>>I see a whole passle of Excel modules on CPAN. 
>> 
>> What exactly is a "passle"?
> 
> You'll have to watch an old John Wayne movie to find out.  :-)

I have seen quite a few John Wayne movies but they were all dubbed. Too 
bad.

I see the OP has provided the meaning. I am duly enlightened.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Fri, 1 Apr 2005 07:54:23 +0100
From: "Kiloran" <me@somewhere.com>
Subject: Re: Database -> Excel
Message-Id: <d2ir50$prs$1@az33news01.freescale.net>


"Robert" <sigzero@gmail.com> wrote in message
news:sigzero-06C786.22411331032005@news.isp.giganews.com...
> I see a whole passle of Excel modules on CPAN. I am querying an Oracle
> database and I want to save that query into an Excel file. What module
> would you suggest that I use?
>
> Robert

I'm using Spreadsheet-WriteExcel with Activestate Perl 5.6.1 on Windows XP
and I'm quite happy with it. It can format cells, column widths, freeze
panes and a bunch of other stuff. It has a limitation of around 7MB per
file, but that is overcome with Spreadsheet-WriteExcel-Big.
I suspect it's quicker to create files this way than using OLE

--Alan




------------------------------

Date: Thu, 31 Mar 2005 17:01:08 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Getting Perl to ignore Letters when calculating numbers.
Message-Id: <slrnd4p09j.do3.tadmc@magna.augustmail.com>

bass150db <bass150db@gmail.com> wrote:

> When I run my script, it dies the first time it sees letters
> instead of numbers.


What does "dies" mean?

Get any messages?

Computer hangs?

Smoke comes out the vents?

I don't see how the code you give below can do what I would call "die",
so you must be using some different definition.

What do you observe when you run your program?


Have you seen the Posting Guidelines that are posted here frequently?


> Let assume I have two arrays as follows:
> 
> 1.  @number = qw( 10 20 300);
> 2.  @letters = qw(A B C);


Errr, that does not help, because you never use either of those
arrays in the code you've shown us.

And what you have stored into @number is NOT numbers, but strings.

   @number = (10, 20, 300);  # @number contains numbers rather than strings


> I want to run a FOREACH command 


foreach is not a command.

Case matters.


> to look at all arrays and total only
> the ones with numbers.  How can I get PERL to ignore Arrays with
> letters and continue down the list?


Your question makes no sense, but I'm beginning to see why...

I think you want to skip array *elements* that are not "numbers".

"An array" and "the elements of an an array" are wildly different concepts.

You don't want to ignore arrays, you want to ignore array elements
that are not "numbers".


> open (STOCKFILE, "p:/Input/allstocks_difference.txt");


You should always, yes *always*, check the return value from open():

   open(STOCKFILE, "p:/Input/allstocks_difference.txt") or
      die "could not open 'p:/Input/allstocks_difference.txt  $!";


> @stock = <STOCKFILE>;


You should always enable strict when developing Perl code!

Have you seen the Posting Guidelines that are posted here frequently?


> chomp (@stock);
> 
> foreach $stock (@stock) {


There is no reason to read the entire file into an array only
to process the array a line at a time anyway.

Just process a line at a time without the need for the @stock
temporary variable.

   foreach my $stock ( <STOCKFILE> ) {
      chomp $stock;


> 	print OUTFILE "@split[2]\n";


You should always enable warnings when developing Perl code!

Have you seen the Posting Guidelines that are posted here frequently?


> 	@numbers = <MYFILE2>;


   my @numbers = grep /^\d+$/, <MYFILE2>; # filter out non-digits strings


I think this is probably the answer to your actual question.


> 	$diff = (($high - $low) / $low) * 100;
> 	$diffround = sprintf("%.2f",$diff);


There is no need for the $diff temporary variable either:

   $diffround = sprintf "%.2f", (($high - $low) / $low) * 100;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 31 Mar 2005 21:00:15 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: Information transfer over the internet
Message-Id: <424cac0f$1_2@127.0.0.1>

Jonas Nilsson wrote:

> Hello
> I would like to transfer some information between two computers with
> internet connection. One computer should act as a server and the other as a
> client. I really don't know much about sockets, ports or protocols.

Check out:

    perldoc perlipc

at a command prompt, particulary the section titled "Internet TCP 
Clients and Servers".  There is example code there which should 
get you on your way.

 ...

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---


------------------------------

Date: Thu, 31 Mar 2005 22:21:43 -0800
From: robic0@yahoo.com
Subject: Re: Performance question
Message-Id: <ujpp41p4olqdf43umn80jgi1gv3tlvfpg2@4ax.com>

On Tue, 29 Mar 2005 13:25:59 -0500, Dave Sill
<MaxFreedom@sws5.ornl.gov> wrote:

>One of my users made the following observation. I'm only an
>occasional, lightweight Perl user, so I can't explain what he's
>seeing. Can anyone shed some light on it? H/W is a pretty large/fast
>Dell server running RHEL 3.
>
>----
>I manufactured a 401x401 [ linearly =160801 element] array [@judy]
>each element having string values like
>
<snip>

I won't be critical of anything beyond this point in your description.
The fact of the matter is that the idea of pre-defining, allocating 
large, multi-dimensional arrays are strictly mental masturbation
of college professors that have nothing at all to do with real-
world programming !!

If the balck box idea is to get data, perform an operation on
it, then put the results somewhere, then this is done on the
micro level -- not the macro level.....
Imagine a cpu holding an entire "exe" in its cache before it
is written to memory and executed.





------------------------------

Date: Thu, 31 Mar 2005 22:42:50 -0800
From: robic0@yahoo.com
Subject: Re: Pulling hair out with pattern matching
Message-Id: <k4rp41t4s8las5n0vsbheb4gh1bqalca1d@4ax.com>

On Wed, 30 Mar 2005 14:20:22 +0800, AcCeSsDeNiEd
<dillon@SpamMinuSaccessdenied.darktech.org> wrote:

>Ok, I don't understand why I always end up finding a solution after posting for help.
>
>This works:
>
>if ($string =~ m/getPolOwnerList.do\?startWith=*/)  {
>
>
>add '\' in front of ?
>
>
>On Wed, 30 Mar 2005 13:49:37 +0800, AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org> wrote:
>
>>$string=qq|<ahref="/fggfd/ra/client/getPolOwnerList.do?startWith=*&selectedUnitID=5445&selectedAdvID=95456&sid=gfhfghfh"|;
>>
>>	if ($string =~ m/getPolOwnerList.do?startWith=*/)  {
>>
>>		print $string;
>>
>>	}
>>
>>
>>This doesn't work. 
>>It seems anything after the '?' in the pattern match is causing problems because this works:
>>
>>
>>if ($string =~ m/getPolOwnerList.do?/)  {
>>
>>
>>Any clues to what is wrong?
>>I'm using perl  v5.6.1 built for MSWin32-x86-multi-thread.
>>
>>Thanks
>>
>>
>>
>>To e-mail, remove the obvious
>
>
>To e-mail, remove the obvious


I know exactly what you are trying to do.
However, you don't know exactly.
Here's a weird subroutine that in context does what
you are trying to do.
What you are trying to do is a paradox, you are trying 
to escape an escape. The fact is you don't know 
what your string feed is so you can't treat it as a constant.
There is only one single way to do it for a variable string feed.
Trust me::

##
##
sub eCHK_RegDel       ## -- checks Redundant Regkey Delete // Regkey
exists --
{
	my ($details) = @_;
	return 1 if (@{$details} == 0);
	my @regdel = ();

	for (@$details) {
		my $aref = $_->[0];
		push (@regdel, $aref) if ($aref->[5] eq $REGISTRY &&
$aref->[6] eq $DELETE);
	}
	if (@regdel)
	{
		## check that KeyName exists
		for (@regdel) {
			my $aref = $_;
			next if (exists ($aref->[4]{$KEYNAME}) &&
length($aref->[4]{$KEYNAME}) > 0);
			# log error
			## 0701 -- test 07,01
			ReportItem ('E', $CLOGINFO, $CERRLOG, '0701',
glicn($aref), (0,0), '', $XML_File, 1,0,1);
		}
		## check redundant regkey deletes
		my $first_kname = '';
		my $first_vname_exists = 0;
		my $aref_first = undef;

		my @regx_esc_codes = ( "\\", '/', '(', ')', '[', ']',
'?', '|',
                                        '+', '.', '*', '$', '^', '{',
'}', '@' );
		for (@regdel)
		{
			my $aref = $_;
			next if (!(exists ($aref->[4]{$KEYNAME}) &&
length($aref->[4]{$KEYNAME}) > 0));
			my $kname = $aref->[4]{$KEYNAME};
			my $vname = '';
			my $kv = 'key (branch)';
			if (exists ($aref->[4]{$VALUENAME})) {
				if (length($aref->[4]{$VALUENAME}) >
0) {
					$vname =
$aref->[4]{$VALUENAME};
					# strip leading spaces
					while ($vname =~ s/^ //) {}
				}
				$kv = 'value';
			}
			for (@regx_esc_codes)
			{
				my $tc = $_;
				my $xx = "\$kname =~
s/\\$tc/\\\\\\$tc/g;";     # code template for regex
				eval $xx;
				#print "$xx\n";
			}
			$kname = $kname."\\\\";
			my $fnd = 0;
			# -- #
			my $ctmpl =  "if (\$kname =~ /^$first_kname/i)
{\$fnd = 1;}";  # code template for first key name
			eval $ctmpl;
			# -- #
			#print
"-------------\n$fnd,$ctmpl\nkname=$kname\n--------------\n\n";
			#print
"-------------\n$fnd,$ctmpl\nkname=$kname\nfirst=$first_kname\n--------------\n\n";
			if ($@) {
				## Check the $ctmpl, get the control
code, log this error as a code issue.
				## This shouldn't happen ... the
compiler will show the escape char, add
				## the char to "@regx_esc_codes", now
its fixed!
				$@ =~ s/^[\x20\n\t]+//; $@ =~
s/[\x20\n\t]+$//;
				## 0702 -- test 07,02
				ReportItem ('E', $CLOGINFO, $CERRLOG,
'0702', (0,0,0,0), $@, $XML_File, 1,0,1);
			}
			if ((!$fnd || length ($first_kname) == 0))
			{
				# because of sort,the first non
valuename
				# will always be in the new keyname
action

				$first_kname = uc($kname);
				for (@regx_esc_codes)
				{
					my $tc = $_;
					my $xx = "\$first_kname =~
s/\\$tc/\\\\\\$tc/g;";     # code template for regex
					eval $xx;
				}
				$aref_first = $aref;
				if (length ($vname) > 0)
{$first_vname_exists = 1} else { $first_vname_exists = 0}
				next;
			}
			next if ($first_vname_exists);
			if (length($vname) == 0) {
				if ($fnd) {
					# log error, this sub-key is
already being deleted
					## 0703 -- test 07,03
					ReportItem ('E', $CLOGINFO,
$CERRLOG, '0703', glicn($aref), glicn($aref_first), '', $XML_File,
1,0,1);
				}
				next;
			}
			# log error, the key for this value is already
being deleted
			## 0704 -- test 07,04
			ReportItem ('E', $CLOGINFO, $CERRLOG, '0704',
glicn($aref), glicn($aref_first), '', $XML_File, 1,0,1);
		}
	}
}





------------------------------

Date: Thu, 31 Mar 2005 22:52:03 -0800
From: robic0@yahoo.com
Subject: Re: Pulling hair out with pattern matching
Message-Id: <herp41l4ucq6j7ph4mcpfl67dd0oq1m7vu@4ax.com>

On Thu, 31 Mar 2005 22:42:50 -0800, robic0@yahoo.com wrote:

>On Wed, 30 Mar 2005 14:20:22 +0800, AcCeSsDeNiEd
><dillon@SpamMinuSaccessdenied.darktech.org> wrote:
>
>>Ok, I don't understand why I always end up finding a solution after posting for help.
>>
>>This works:
>>
>>if ($string =~ m/getPolOwnerList.do\?startWith=*/)  {
>>
>>
>>add '\' in front of ?
>>
>>
>>On Wed, 30 Mar 2005 13:49:37 +0800, AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org> wrote:
>>
>>>$string=qq|<ahref="/fggfd/ra/client/getPolOwnerList.do?startWith=*&selectedUnitID=5445&selectedAdvID=95456&sid=gfhfghfh"|;
>>>
>>>	if ($string =~ m/getPolOwnerList.do?startWith=*/)  {
>>>
>>>		print $string;
>>>
>>>	}
>>>
>>>
>>>This doesn't work. 
>>>It seems anything after the '?' in the pattern match is causing problems because this works:
>>>
>>>
>>>if ($string =~ m/getPolOwnerList.do?/)  {
>>>
>>>
>>>Any clues to what is wrong?
>>>I'm using perl  v5.6.1 built for MSWin32-x86-multi-thread.
>>>
>>>Thanks
>>>
>>>
>>>
>>>To e-mail, remove the obvious
>>
>>
>>To e-mail, remove the obvious
>
>

Just to interject here, read up on eval.
Better yet, mull through the high-powered
perl modules that use eval for code templates.
You cannot "odd" escape, escape codes with
slashes. To interject escape slashes on "escape"
codes you need code templates written for eval.
Examine this code, extract the 2 main code templates
and thats all you need. Do the @esc eval on the 
string, then do the eval on the variable string.
This is the extreme paradox of regx....this handles
ALL cases!


>I know exactly what you are trying to do.
>However, you don't know exactly.
>Here's a weird subroutine that in context does what
>you are trying to do.
>What you are trying to do is a paradox, you are trying 
>to escape an escape. The fact is you don't know 
>what your string feed is so you can't treat it as a constant.
>There is only one single way to do it for a variable string feed.
>Trust me::
>
>##
>##
>sub eCHK_RegDel       ## -- checks Redundant Regkey Delete // Regkey
>exists --
>{
>	my ($details) = @_;
>	return 1 if (@{$details} == 0);
>	my @regdel = ();
>
>	for (@$details) {
>		my $aref = $_->[0];
>		push (@regdel, $aref) if ($aref->[5] eq $REGISTRY &&
>$aref->[6] eq $DELETE);
>	}
>	if (@regdel)
>	{
>		## check that KeyName exists
>		for (@regdel) {
>			my $aref = $_;
>			next if (exists ($aref->[4]{$KEYNAME}) &&
>length($aref->[4]{$KEYNAME}) > 0);
>			# log error
>			## 0701 -- test 07,01
>			ReportItem ('E', $CLOGINFO, $CERRLOG, '0701',
>glicn($aref), (0,0), '', $XML_File, 1,0,1);
>		}
>		## check redundant regkey deletes
>		my $first_kname = '';
>		my $first_vname_exists = 0;
>		my $aref_first = undef;
>
>		my @regx_esc_codes = ( "\\", '/', '(', ')', '[', ']',
>'?', '|',
>                                        '+', '.', '*', '$', '^', '{',
>'}', '@' );
>		for (@regdel)
>		{
>			my $aref = $_;
>			next if (!(exists ($aref->[4]{$KEYNAME}) &&
>length($aref->[4]{$KEYNAME}) > 0));
>			my $kname = $aref->[4]{$KEYNAME};
>			my $vname = '';
>			my $kv = 'key (branch)';
>			if (exists ($aref->[4]{$VALUENAME})) {
>				if (length($aref->[4]{$VALUENAME}) >
>0) {
>					$vname =
>$aref->[4]{$VALUENAME};
>					# strip leading spaces
>					while ($vname =~ s/^ //) {}
>				}
>				$kv = 'value';
>			}
>			for (@regx_esc_codes)
>			{
>				my $tc = $_;
>				my $xx = "\$kname =~
>s/\\$tc/\\\\\\$tc/g;";     # code template for regex
>				eval $xx;
>				#print "$xx\n";
>			}
>			$kname = $kname."\\\\";
>			my $fnd = 0;
>			# -- #
>			my $ctmpl =  "if (\$kname =~ /^$first_kname/i)
>{\$fnd = 1;}";  # code template for first key name
>			eval $ctmpl;
>			# -- #
>			#print
>"-------------\n$fnd,$ctmpl\nkname=$kname\n--------------\n\n";
>			#print
>"-------------\n$fnd,$ctmpl\nkname=$kname\nfirst=$first_kname\n--------------\n\n";
>			if ($@) {
>				## Check the $ctmpl, get the control
>code, log this error as a code issue.
>				## This shouldn't happen ... the
>compiler will show the escape char, add
>				## the char to "@regx_esc_codes", now
>its fixed!
>				$@ =~ s/^[\x20\n\t]+//; $@ =~
>s/[\x20\n\t]+$//;
>				## 0702 -- test 07,02
>				ReportItem ('E', $CLOGINFO, $CERRLOG,
>'0702', (0,0,0,0), $@, $XML_File, 1,0,1);
>			}
>			if ((!$fnd || length ($first_kname) == 0))
>			{
>				# because of sort,the first non
>valuename
>				# will always be in the new keyname
>action
>
>				$first_kname = uc($kname);
>				for (@regx_esc_codes)
>				{
>					my $tc = $_;
>					my $xx = "\$first_kname =~
>s/\\$tc/\\\\\\$tc/g;";     # code template for regex
>					eval $xx;
>				}
>				$aref_first = $aref;
>				if (length ($vname) > 0)
>{$first_vname_exists = 1} else { $first_vname_exists = 0}
>				next;
>			}
>			next if ($first_vname_exists);
>			if (length($vname) == 0) {
>				if ($fnd) {
>					# log error, this sub-key is
>already being deleted
>					## 0703 -- test 07,03
>					ReportItem ('E', $CLOGINFO,
>$CERRLOG, '0703', glicn($aref), glicn($aref_first), '', $XML_File,
>1,0,1);
>				}
>				next;
>			}
>			# log error, the key for this value is already
>being deleted
>			## 0704 -- test 07,04
>			ReportItem ('E', $CLOGINFO, $CERRLOG, '0704',
>glicn($aref), glicn($aref_first), '', $XML_File, 1,0,1);
>		}
>	}
>}
>
>



------------------------------

Date: Thu, 31 Mar 2005 17:05:50 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Redirect on the NO pushing button
Message-Id: <slrnd4p0ie.do3.tadmc@magna.augustmail.com>

PHP2 <nospam@nospam.tv> wrote:
> I am create edit data form, 


What is an "edit data form"?

There is no such construction in Perl that I know of.


> and it ask visitor: "do you wish edit data?"
> 
> All is ok with Yes button, but I don't kniw what with No button :-)


Perl does not have any buttons, what are you talking about?

Are you using the Tk module?


> I wish that clicking NO button recirect me on some URL..


Oh, you don't have a Perl question, you have a CGI question.


> Any help


You are expected to check the Perl FAQ *before* posting to the
Perl newsgroup you know.

   perldoc -q redirect

       How do I redirect to another page?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 31 Mar 2005 21:21:04 -0600
From: axel@white-eagle.invalid.uk
Subject: Re: Redirect on the NO pushing button
Message-Id: <9cidnc_6qPu9I9HfRVn-3Q@adelphia.com>

Sherm Pendley <spamtrap@dot-app.org> wrote:
> So, to answer your (CGI) question: Assign a "name" attribute to both of the
> buttons. When one of them is clicked, two params are sent to your CGI. For
> example, if the user clicks a button with a "name='foo'" attribute, then
> your CGI will receive 'foo.x' and 'foo.y' parameters. The X and Y values
> aren't useful for buttons, but you can check for the existence of
> parameters with those names to see which button was clicked.
 
The foo.x and foo.y parameters will only be sent if the button is an
image. But the foo parameter will be sent for both images and actual
'buttons' (i.e. INPUT TYPE=SUBMIT in HTML).

So, for the OP: set up two buttons, 'Yes' & 'No', give them appropriate
names as Sherm mentioned above.  Check (using the CGI module or
whatever means you prefer) if the 'Yes' button has been used - if
so do whatever you currently do.

But if you find that the 'No' button has been clicked, just send
whatever you want to send instead - I believe a redirection to a
URL was specified in which case just use:

	print "Location: http://some.where.else/\n\n";

Axel





------------------------------

Date: 31 Mar 2005 19:22:48 -0800
From: srithota@gmail.com
Subject: Unable to connect to remote host
Message-Id: <1112325768.317407.88960@l41g2000cwc.googlegroups.com>

I'm running CGI program (written using perl) with Tomcat.
Cgi program written in perl has a telnet operation. It is trying to
connect to a port on a remote host. When i run the perl script as a
standalone, it works perfectly. when i try to run the same script with
tomcat server i am getting the following error.

Mar 31, 2005 9:37:21 PM org.apache.catalina.core.ApplicationContext log
INFO: cgi: runCGI (stderr):problem creating socket: Unknown error at
C:/Perl/sit
e/lib/AOLserver/CtrlPort.pm line 125

ctrlport.pm is the perl module and line 125 in the module is my $t =
Net::Telnet->new(%options);


METHOD

############################################################
sub new {
############################################################
    my ($class, @options) = @_;

    my %options = (
        Timeout         => 20,
        Port            => '3456',
        Host            => 'localhost',
        Prompt          => '/Ok/',
        User            => '',
        Password        => '',
        @options);


Any suggestion or solution ?


Thanks. 
Sri



------------------------------

Date: Thu, 31 Mar 2005 23:16:07 -0800
From: robic0@yahoo.com
Subject: Re: Using a for() statement to create a variable??
Message-Id: <o5tp41hf4q1hbdlu4v34r63ptvmk9ufgdb@4ax.com>

On Wed, 30 Mar 2005 08:03:25 +0100, Henry Law
<lawshouse.public@btconnect.com> wrote:

>On 26 Mar 2005 16:04:11 -0800, "robic0@yahoo.com" <robic0@yahoo.com>
>wrote:
>
>>I suggest you not mention "kill" as an attribute within your reply.
>>Should you feel the need
>>to kill someone, I suggest you consult proffessional help immediatly.
>>In America, we do not
>>take kindly to threats from individuals from foreign countries. Your
>>time may well be better
>>spent mastering english and gaining insite on American culture.
>
>Hey, Robic0, I have to thank you for providing me with several minutes
>of fun, catching up with the newsgroup this morning.  Far from
>killfiling you (I guess you know what that means now) I've actually
>been searching the group for your posts.  The technical ones aren't
>very interesting: they're rather obscure and from the reactions of the
>Perl mavens here I suspect they're not very accurate; but the
>non-technical ones like this are a hoot.  
>
>The way you assume that Google is the same as USENET, and that the
>group is a "site", and that the whole thing is in some way "owned" by
>the USA and that everyone with a European or Asian name is therefore a
>"foreigner" and to be deprecated in some way ... you provide more and
>more fun with each thread.  And the myopic pomposity you manage to get
>into every post just cracks me up.  Thanks.


HHHHHHEEEEEEEYYYYYYYYYYYYYY
HEEEEEEEEEEEEEEENNNNNNNRRRRRRRRYYYYYYYYY !!!!!!!!!!!!!

How the fuck are ya man ?????????


------------------------------

Date: Thu, 31 Mar 2005 23:30:13 -0800
From: robic0@yahoo.com
Subject: Re: Using a for() statement to create a variable??
Message-Id: <hrtp415f7hfa7ncen68fkntbuspej17f8f@4ax.com>

>Just FYI: UseNet is not America.
>Sinan.

Al Gore -> *****U S A*****  --->>>>>  ArpaNnet --> UseNet --> <you,
the foreigner who taketh away American jobs>



------------------------------

Date: Thu, 31 Mar 2005 22:33:55 -0800
From: robic0@yahoo.com
Subject: Re: using Perl to insert footer into PDF files?
Message-Id: <0oqp4153sp39m2tocd4r3t1t36kubvhhop@4ax.com>

On 29 Mar 2005 14:41:22 -0800, codingalex@yahoo.com wrote:

>I'm a little new at PDF manipulation in Perl and I'm not completely
>convinced that what I want to do is even possible. Basically what i
>want to do is take a multi-page PDF file and insert a footer onto the
>bottom of every page along with sequential page numbers. I've been
>tinkering with the PDF::API2 module, which looks promising but which
>appears to be a little slim on documentation. Can someone point me in
>the right direction on this?
>
>Thanks a lot,
>Alex


Whoa man, pdf is proprietory. If you find out how to modify pdf's
I wouldn't sell it to anyone...



------------------------------

Date: Thu, 31 Mar 2005 22:04:13 -0800
From: robic0@yahoo.com
Subject: Re: Why doesn't Perl have cp or mv?
Message-Id: <oqop41l9uie8715kfp1btterqb4609iotc@4ax.com>

On Sat, 26 Mar 2005 22:41:52 -0500, Andras Malatinszky
<nobody@dev.null> wrote:

>Why is it that Perl emulates Unix commands like chmod and chown but not 
>such basic operations like cp or mv?


using File::Copy,

move is done via os-rename function into the "ToDir".
rename ("From","To");

-- you don't think Perl rewrites file systems do you....
  Somethings in Perl distribution are rewritten emulations of the
original lang constuct, like printf, etc.... but you gotta believe
it just "wraps" most os api's.




------------------------------

Date: Thu, 31 Mar 2005 22:28:39 -0800
From: robic0@yahoo.com
Subject: Re: YARQ - Yet another regex question
Message-Id: <teqp41l89m34dftbkejk22bdn82hdght1q@4ax.com>

On Tue, 29 Mar 2005 18:37:50 GMT, sjp <salvador@progressivetrail.org>
wrote:

>Hi folks,
>
>I'm parsing through a series of delimited records.  Some of the records
>use '\t' for the delimiter, and others use '=09' as the delimiter.  My
>program handles the tab-delimited records fine, but records that use '=09'
>have erroneous line breaks after '=' signs, like so:
>
>93=093=094/1/2004=09=09HARNEY=09JAMES=09808 SITKA AVE=09=09NEWBERG=09OR=099=
>71320000=098.33=09I=09CA=09PARK RANGER=09=0966.64=09=09=09=09=09=09PARKS & =
>RECREATION DIVISION=09
>
>I'd like to remove the '=' and EOL, but 'Sline =~ s/\=\n//g;' fails with
>an "Can't modify constant item in substitution (s///) at
>/usr/local/bin/mailparse line 18, near "s/\=\n//g;" error
>
>What is the proper way to do it?
>
>Thanks,
>
>SJP


$line =~ s/[=\n]+//g;



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7930
***************************************


home help back first fref pref prev next nref lref last post