[25578] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7822 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 24 03:06:09 2005

Date: Thu, 24 Feb 2005 00:05:30 -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           Thu, 24 Feb 2005     Volume: 10 Number: 7822

Today's topics:
    Re: Annoying Problem with a Basic Perl app and XP Pro <tadmc@augustmail.com>
    Re: Comparing huge XML Files <tadmc@augustmail.com>
    Re: Credit cards storage <nospam@bigpond.com>
    Re: Credit cards storage <saidev@gmail.com>
    Re: Credit cards storage <cwilbur@mithril.chromatico.net>
    Re: file parsing.. <josef.moellers@fujitsu-siemens.com>
    Re: glob <jkeen_via_google@yahoo.com>
        IE Doesn't Display Romanian Page! (Farhad)
        maximum size of a hash table <lskatz@gmail.com>
    Re: maximum size of a hash table <tadmc@augustmail.com>
    Re: maximum size of a hash table <postmaster@castleamber.com>
    Re: maximum size of a hash table <tassilo.von.parseval@rwth-aachen.de>
    Re: OOP Tutorial <abigail@abigail.nl>
        Passing variables to frames <divyanrao@gmail.com>
    Re: Passing variables to frames <1usa@llenroc.ude.invalid>
    Re: Passing variables to frames <noreply@gunnar.cc>
    Re: Passing variables to frames <1usa@llenroc.ude.invalid>
    Re: Passing variables to frames <noreply@gunnar.cc>
    Re: Perl DBI and Microsoft Access nathaniel_welch@hotmail.com
        Permission denied at C:/Perl/site/lib/XML/Handler/YAWri (Piet L.)
        re-sizing large graphs to fit web display zhilianghu@gmail.com
    Re: re-sizing large graphs to fit web display <nospam@bigpond.com>
    Re: re-sizing large graphs to fit web display <postmaster@castleamber.com>
    Re: Read from keyboard <josef.moellers@fujitsu-siemens.com>
    Re: Reading compressed file and its conversion to numbe strangeman@strangecomputer.org
    Re: regexp (Anno Siegel)
        testing <webmaster @ infusedlight.net>
    Re: testing <dha@panix.com>
    Re: testing <jurgenex@hotmail.com>
    Re: unicode: =?UTF-8?B?w6k9PmUsIMOhPT5h?= <groleau+news@freeshell.org>
        Why declare "my $something" on top if it's going to get strangeuser@strangesomputer.com
    Re: Why declare "my $something" on top if it's going to <wyzelli@yahoo.com>
    Re: Why declare "my $something" on top if it's going to <tadmc@augustmail.com>
    Re: Why declare "my $something" on top if it's going to <newspost@kohomban.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 23 Feb 2005 17:43:50 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Annoying Problem with a Basic Perl app and XP Pro
Message-Id: <slrnd1q59m.704.tadmc@magna.augustmail.com>

arek <jpmythic@ntlworld.com> wrote:
> Hmm...  So the Perl Code I posted,
> Which I had modified from another Authors Code that
> has been heavily involved in Perl for years WAS NOT PERL CODE?


If it has syntax errors then it is not Perl.


> YOU make me Laugh!


I'm crushed, since I value your opinion so highly.


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


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

Date: Wed, 23 Feb 2005 10:33:44 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Comparing huge XML Files
Message-Id: <slrnd1pc38.6fk.tadmc@magna.augustmail.com>

Jürgen Exner <jurgenex@hotmail.com> wrote:
> xhoster@gmail.com wrote:
>> "junnuthala" <junnuthula@yahoo.com> wrote:
>>> Can someone please suggest me a Perl module for comparing huge XML
>>> Files.
>>
>> How about just an ordinary text-based file diff on them?
> 
> Bin there, done that, not a good idea.
> XML is a format-free language while text-based diff tools mark every swapped 
> parameter, every additional line break or space as a difference. Totally 
> useless to compare XML files.


 ... unless you normalize them first.


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


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

Date: Thu, 24 Feb 2005 09:10:06 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Credit cards storage
Message-Id: <384gqfF5js3klU1@individual.net>

saidev@gmail.com wrote:

> Just want to get some ideas on how everyone store Credit Card
> information into MySQL.  I know I can't use the one way encryption, if
> the customer come back, I won't be able to provide the correct
> information to the bank.  What is the safest way to store user CC
> information?  I'll be modifying an existance Perl program to do this,
> any modules can help me do this?  Thanks.

If you need to use a symmetric algorithm like RC4:
http://search.cpan.org/dist/Crypt-RC4/RC4.pm

gtoomey


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

Date: 23 Feb 2005 19:53:24 -0800
From: "saidev" <saidev@gmail.com>
Subject: Re: Credit cards storage
Message-Id: <1109217204.769109.3690@z14g2000cwz.googlegroups.com>

Thanks for all your reply, I think I'll have to come up with some valid
reason for my boss and him know that is a BAD idea....I've been
fighting/ignoring him about this for the past 6 months.  I wonder how
does places like amazon.com or other places that store CC information
store their information?  Now, I'm just asking out of curiosity.



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

Date: Thu, 24 Feb 2005 06:09:17 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Credit cards storage
Message-Id: <87mztuij6f.fsf@mithril.chromatico.net>

>>>>> "s" == saidev  <saidev@gmail.com> writes:

    s> Thanks for all your reply, I think I'll have to come up with
    s> some valid reason for my boss and him know that is a BAD
    s> idea....I've been fighting/ignoring him about this for the past
    s> 6 months.  I wonder how does places like amazon.com or other
    s> places that store CC information store their information?  Now,
    s> I'm just asking out of curiosity.

There's a cost-benefit balance and a risk-reward balance involved in
storing credit card numbers.  If you're actually storing enough
information to make a charge on a credit card, then that database is
incredibly valuable to just about anyone, and you're liable if it gets
stolen.  In a worst-case scenario, you lose your merchant account and
have to compensate the credit card company for anything that is
charged through fraud or error.  And the programmer responsible for it
(you) doesn't know how to store the information securely.  Is not
requiring customers to re-enter their credit card information for
subsequent orders really worth that level of risk?

(If your boss says yes, get it in writing, and make sure he signs off
on any security scheme you're using.)

Amazon probably has a hefty insurance policy or special contract terms
with their credit card processor; this is something you can do when
you have the funds and sales volume that Amazon does.  Netflix's
business model depends on storing credit cards for recurring monthly
charges; it's a safe bet that they've invested a hell of a lot of
money and time in making sure their database is secure.  It's not that
storing credit card numbers is inherently and always a stupid move;
it's that it is a risky one that requires a lot of knowledge and work
to offset the risk and a lot of reward to make the risk worthwhile.

Charlton

-- 
cwilbur at chromatico dot net
cwilbur at mac dot com


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

Date: Thu, 24 Feb 2005 09:00:42 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: file parsing..
Message-Id: <cvk1ka$96c$1@nntp.fujitsu-siemens.com>

jl_post@hotmail.com wrote:
> cleargu...@yahoo.com wrote:
>=20
>>I have below script and I need to translate a
>>full name to a login ID.
>>
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>while (<DATA>)
>>  {
>>   ($last, $first) =3D split ("\s+", $_);
>>   $login =3D $first[0] . $last;
>>   print "$login\n";
>>  }
>>
>>__DATA__
>>Smith Bob
>>Carter John
>>Fisher Ann
>>Lewis Maggy
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>
>>Output should be:
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>bsmith
>>jcarter
>>afisher
>>mlewis
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>
>>How can I modify the aboe script to get the desired output?
>=20
>=20
>=20
> Dear Rider,
>=20
>    First, know that just using split() with no parameters is almost the=

> same as:
>=20
>       split(/\s+/, $_)
>=20
>    Second, saying $first[0] does NOT give you the first letter of the
> $first variable.  Instead it gives you the first ELEMENT of the @first
> ARRAY.  To get the first letter of the $first variable, use substr()
> instead, like this:
>=20
>       substr($first, 0, 1)
>=20
>    Therefore, I think this code will do exactly what you want:
>=20
> while (<DATA>)
> {
>    ($last, $first) =3D split;
>    $login =3D substr($first, 0, 1) . $last;
>    print "$login\n";
> }
> __DATA__
> Smith Bob
> Carter John
> Fisher Ann
> Lewis Maggy

Dear Jean-Luc,

Please (pretty please, with sugar on top, as my cousing from down under=20
used to say) TRY YOUR SOLUTIONS BEFORE POSTING (this is your second=20
reply in sequence which falls short of this simple requirement)!
Your solution DOES NOT "do exactly what you want", as a simple test will =

reveal, because the output will be

BSmith
JCarter
AFisher
MLewis

Note the difference? (Hint: look at the case of the letters)

Rider will also have to lc the strings or the entire result:

while (<DATA>)
{
    ($last, $first) =3D split;
    $login =3D lc substr($first, 0, 1) . $last;
    print "$login\n";
}
__DATA__
Smith Bob
Carter John
Fisher Ann
Lewis Maggy

Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Thu, 24 Feb 2005 00:27:32 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: glob
Message-Id: <Ub9Td.30009$ya6.20673@trndny01>

Emanuele Matli wrote:
> Hi,
> 
> I have a problem using glob on my cgi perl program.
> If I try to call glob twice the program crashes giving one of this errors:
> 
> *** malloc[2302]: error for object 0xbffffe20: Pointer being reallocated 
> was not allocated
> Out of memory!
> 
> *** malloc[2396]: Deallocation of a pointer not malloced: 0x65726c00; 
> This could be a double free(), or free() called with the middle of an 
> allocated block; Try setting environment variable MallocHelp to see 
> tools to help debug
> Segmentation fault

Are you sure that these are Perl errors?

I grepped the Perl documentation for 'malloc' 
(http://search.cpan.org/grep?release=perl-5.8.6&string=malloc&i=1&n=1) 
and couldn't locate any such phrases as "error for object" or 
"Deallocation of a pointer".

Could you please present the Perl code which is causing the problems? 
We would then have a better chance at diagnosing them.  Thanks.

jimk


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

Date: 23 Feb 2005 22:30:42 -0800
From: farhada@gmail.com (Farhad)
Subject: IE Doesn't Display Romanian Page!
Message-Id: <e6ab387e.0502232230.5be2ed9d@posting.google.com>

Hi Everbody,

We have a client that has a page with romanian characters which IE
doesn't want to display. Serving static romanian pages works fine with
the server. But this one is served dynamically via a perl script.

In IE certain characters are displayed as empty boxes when the file is
served, but if the file is saved and viewed locally it displays fine.
Firefox displays perfectly. The character encoding on this has beeb set
to be the romanian one (ISO-8859-16) in the head section of the html,
( <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-16"> ). For example here is a part of source code of
HTML page which is been served.

<td height="22" colspan="2"><strong>4</strong>. Urmând clinica, la ce
beneficii v-a&#355;i a&#351;teptat în urma implement&#462;rii EM ?
<br><em>V&#462; rug&#462;m bifa&#355;i tot ce se aplic&#462;.</em>
</td>

If you want to have a look at the page, here is the url and user/pass,

http://www.eeimplementors.org/index.pl?page=65

Username: t...@internetrix.com.au
Password: apache

If you've got any ideas, I'd appreciate them.

Thanks for your time,
Farhad


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

Date: 23 Feb 2005 19:30:48 -0800
From: "Lee" <lskatz@gmail.com>
Subject: maximum size of a hash table
Message-Id: <1109215848.666304.259450@g14g2000cwa.googlegroups.com>

I couldn't find a clear answer to this.  Seems to be a lot of hearsay.

Does anyone absolutely know the maximum size that a hash table can
achieve?



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

Date: Wed, 23 Feb 2005 23:05:10 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: maximum size of a hash table
Message-Id: <slrnd1qo46.7fp.tadmc@magna.augustmail.com>

Lee <lskatz@gmail.com> wrote:

> Does anyone absolutely know the maximum size that a hash table can
> achieve?


No, because it depends on the particular data being stored and the
size of the memory on your particular machine.

You can keep adding elements until your machine runs out of memory.


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


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

Date: 24 Feb 2005 06:12:54 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: maximum size of a hash table
Message-Id: <Xns96072300E035castleamber@130.133.1.4>

Tad McClellan wrote:

> Lee <lskatz@gmail.com> wrote:
> 
>> Does anyone absolutely know the maximum size that a hash table can
>> achieve?
> 
> No, because it depends on the particular data being stored and the
> size of the memory on your particular machine.

Isn't there a limit on the number of bits in the hash? 
Just curious.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Thu, 24 Feb 2005 08:04:53 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: maximum size of a hash table
Message-Id: <slrnd1qv4l.qd.tassilo.von.parseval@localhost.localdomain>

Also sprach John Bokma:
> Tad McClellan wrote:
>
>> Lee <lskatz@gmail.com> wrote:
>> 
>>> Does anyone absolutely know the maximum size that a hash table can
>>> achieve?
>> 
>> No, because it depends on the particular data being stored and the
>> size of the memory on your particular machine.
>
> Isn't there a limit on the number of bits in the hash? 
> Just curious.

What bits? Perl hashes are not bloom filters so the concepts of bits (or
the number thereof) isn't involved anywhere.

Tassilo
-- 
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);


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

Date: 24 Feb 2005 00:28:29 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: OOP Tutorial
Message-Id: <slrnd1q7td.p92.abigail@alexandra.abigail.nl>

Leslie Viljoen (leslievNO@SPAMicoc.co.za) wrote on MMMMCXCIV September
MCMXCIII in <URL:news:GdGdnSF2MveG1YHfRVn-vA@is.co.za>:
$$  Hi All
$$  
$$  Please forgive the cross-post, I hear comp.lang.perl is defunct.

Yeah. For about 8 or 9 years now.

$$  Anyway, I have written yet another Perl OOP tutorial. If you are

Good. I'm currently writing an OO related talk (one of the slides is
called "I hate objects").

$$  interested, I'd appreciate your comments on it:

Ok.

$$  http://www.icon.co.za/~mobeus/easyoop.doc.zip      (Word)
$$  http://www.icon.co.za/~mobeus/easyoop.sxw.zip      (Open Office)

Oh. Never mind. I don't do Windows.



Abigail
-- 
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: 23 Feb 2005 19:44:14 -0800
From: "divya" <divyanrao@gmail.com>
Subject: Passing variables to frames
Message-Id: <1109216654.641937.174730@z14g2000cwz.googlegroups.com>

This is the problem I am having:
 I have an index page where I obtain input from the user (for example
their date of birth). This information is passed to Page2. Page2 has
frames. Outside of the frames I can access the user's input. But within
the frames I can't seem to be able to get the value. The date is stored
in a global variable.
Here are snippet's of code:

##Variables
my ($BDAY, $path_info, $script_name);

##Obtaining value from the index page
if ($q->param('birthday')) {
   $BDAY = $q->param('birthday');
}

##Creating frame
$path_info = $q->path_info;

##Printing the fames
if (!$path_info) {
    &print_frameset($BDAY);
    exit 0;
}

##Printing the different frames
&print_html_header;                  ##HTML headers
&print_content if $path_info=~/content/;    ##Left pane with links
&print_expand($BDAY) if $path_info=~/expand/;      ##Expanded graph
&print_analyse if $path_info=~/analyse/;        ##Options to do
analysis
&print_end;                                     ##End HTML
&print_error;

##Setting up the frames
sub print_frameset {

    my $birthday = shift;
    $script_name = $q->script_name;

    print "<html><head><title>$TITLE</title></head>";
    print "<frameset cols='8%,92%'>";
       print "<frame src='$script_name/content' name='content'>";
       print "<frameset rows='70%,30%'>";
          if ($birthday) {
             print "<frame src='$script_name/expand' name='expand'>";
             print "<frame src='$script_name/analyse' name='analyse'>";
          }
          else {
             print "<frame src='$script_name/error' name='error'>";
          }
       print "</frameset>";
    print "</frameset>";

    exit 0;
}

One of the frame's contents:
sub print_expand {

   my $birthday = shift;
   print $q->h3("My birthday is on: $birthday");

}

In this frame all it prints is "My birthday is on: " it is not printing
the variable.

I cannot figure out why I cannot get the value in the subroutines. I
have checked and the value does get passed from the index page to this
page. I can print it from the global variable $BDAY but not from the
sub routines that form the frames.

I have spent almost 2 days on this and I am starting to go insane!! I
would appreciate any hints/help/suggestions you can provide.

Thanks!
Me



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

Date: Thu, 24 Feb 2005 04:04:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Passing variables to frames
Message-Id: <Xns9606EACCF4560asu1cornelledu@127.0.0.1>

"divya" <divyanrao@gmail.com> wrote in news:1109216654.641937.174730
@z14g2000cwz.googlegroups.com:

> This is the problem I am having:
>  I have an index page where I obtain input from the user (for example
> their date of birth). This information is passed to Page2. Page2 has
> frames. Outside of the frames I can access the user's input. But
> within the frames I can't seem to be able to get the value. 

You do not have a Perl question. You just do not know HTML & CGI. You 
should direct HTML queries to 

comp.infosystems.www.authoring.html

and CGI queries to

comp.infosystems.www.authoring.cgi

> my ($BDAY, $path_info, $script_name);

Declare variables in the smallest applicable scope.

> ##Obtaining value from the index page
> if ($q->param('birthday')) {

$q is not defined at this point. 

use strict;
use warnings;

would have told you that.

>    $BDAY = $q->param('birthday');
> }
> 
> ##Creating frame
> $path_info = $q->path_info;
> 
> ##Printing the fames
> if (!$path_info) {
>     &print_frameset($BDAY);

Do you know the difference between 

&print_frameset($BDAY) 

and 

print_frameset($BDAY)?

If you do not need the specific effects of using &print_frameset, then 
you should not use it. See 

perldoc perlsub

for more information.

Sinan


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

Date: Thu, 24 Feb 2005 05:24:45 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Passing variables to frames
Message-Id: <3853q7F5k1q51U1@individual.net>

divya wrote:
> This is the problem I am having:
> I have an index page where I obtain input from the user (for example
> their date of birth). This information is passed to Page2. Page2 has
> frames. Outside of the frames I can access the user's input. But within
> the frames I can't seem to be able to get the value.

Do you realize that the script is called multiple times? The first time 
it only prints the frameset file.

>        print "<frame src='$script_name/content' name='content'>";

Here the script is called a second time from the frameset file, and as 
far as I can see, no parameters are passed to it that time...

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Thu, 24 Feb 2005 04:34:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Passing variables to frames
Message-Id: <Xns9606EFC99D579asu1cornelledu@127.0.0.1>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in 
news:Xns9606EACCF4560asu1cornelledu@127.0.0.1:

> "divya" <divyanrao@gmail.com> wrote in news:1109216654.641937.174730
> @z14g2000cwz.googlegroups.com:
> 
>> This is the problem I am having:
>>  I have an index page where I obtain input from the user (for example
>> their date of birth). This information is passed to Page2. Page2 has
>> frames. Outside of the frames I can access the user's input. But
>> within the frames I can't seem to be able to get the value. 
> 
> You do not have a Perl question. You just do not know HTML & CGI.

Well, I just re-read this, and realized that it comes accross harsher 
than I had intended. What you have is:

>              print "<frame src='$script_name/expand' name='expand'>";
>              print "<frame src='$script_name/analyse' 
name='analyse'>";

These will result in two fresh invocations of your script without the 
birthday parameter.

See

<URL: http://search.cpan.org/~lds/CGI.pm-3.05/CGI.pm#CREATING_A_SELF-
REFERENCING_URL_THAT_PRESERVES_STATE_INFORMATION:>

and 

<URL: http://search.cpan.org/~lds/CGI.pm-
3.05/CGI.pm#WORKING_WITH_FRAMES>

for more information.

Sinan.


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

Date: Thu, 24 Feb 2005 05:56:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Passing variables to frames
Message-Id: <3855l6F5j5j1cU1@individual.net>

A. Sinan Unur wrote:
> 
> <URL: http://search.cpan.org/~lds/CGI.pm-3.05/CGI.pm#CREATING_A_SELF-REFERENCING_URL_THAT_PRESERVES_STATE_INFORMATION:>

It should be noted that CGI.pm's self_url() method translates all 
parameters, whether submitted via POST or GET, to a query string. If 
there initially were info passed to the script, that you wouldn't like 
that the server sends to the user and saves in the access log, it may be 
advisable to add the necessary query string manually. In this case it 
seems to be:

     my $querystring = "?birthday=$BDAY";

(The need for URI escaping should better be considered, of course.)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 23 Feb 2005 17:00:05 -0800
From: nathaniel_welch@hotmail.com
Subject: Re: Perl DBI and Microsoft Access
Message-Id: <1109206805.719847.87740@z14g2000cwz.googlegroups.com>

The server is a Windows 2003 box using Perl 5.6.1.

I had previously been running my own server on my personal PC, but due
to obvious reasons (security, downtime, against cable modem company
rules, etc) I decided to purchase web space.  My perl scripts worked
completely fine on my personal box.  I have tested DBI::PurePerl on my
personal box and I can't get it to work.



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

Date: 23 Feb 2005 23:59:20 -0800
From: PietLaroy@hotmail.com (Piet L.)
Subject: Permission denied at C:/Perl/site/lib/XML/Handler/YAWriter.pm line 43.
Message-Id: <c47f81f6.0502232359.2a0dbdac@posting.google.com>

Hey,

I get this error when I try following code:

my $handler   = XML::Handler::YAWriter->new(AsFile => "c:\\z.xml");
my $generator = XML::Generator::DBI->new(
   Handler => $handler,
   dbh     => $dbh
);

AsString => "-" work good.

thanks


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

Date: 23 Feb 2005 17:16:55 -0800
From: zhilianghu@gmail.com
Subject: re-sizing large graphs to fit web display
Message-Id: <1109207815.920796.100660@f14g2000cwb.googlegroups.com>


I am looking for a tool (or I can program one if not too complicated)
in perl that can resize large graphs to better serve the web?  (No, not
to use <img width= height= ...> to "re-size" but re-size the graph
itself)

It is most appreciated if someone could kindly provide some clues where
to get started... (any perl module does this?  I searched Google/books
and don't seem to be lucky enough to find one).

Thanks!
Zhiliang



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

Date: Thu, 24 Feb 2005 12:14:25 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: re-sizing large graphs to fit web display
Message-Id: <384rk5F5gh8rbU1@individual.net>

zhilianghu@gmail.com wrote:

> 
> I am looking for a tool (or I can program one if not too complicated)
> in perl that can resize large graphs to better serve the web?  (No, not
> to use <img width= height= ...> to "re-size" but re-size the graph
> itself)
> 
> It is most appreciated if someone could kindly provide some clues where
> to get started... (any perl module does this?  I searched Google/books
> and don't seem to be lucky enough to find one).
> 
> Thanks!
> Zhiliang

If you are talking about resizing gifs/jpegs then many use http://www.imagemagick.com/

Resizing tutorial for imagemagick:
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/resize/

There is a Perl interface too:
http://search.cpan.org/dist/PerlMagick/Magick.pm


gtoomey
www.gregorytoomey.com


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

Date: 24 Feb 2005 03:07:32 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: re-sizing large graphs to fit web display
Message-Id: <Xns9606D6E632186castleamber@130.133.1.4>

 wrote:

> 
> I am looking for a tool (or I can program one if not too complicated)
> in perl that can resize large graphs to better serve the web?  (No, not
> to use <img width= height= ...> to "re-size" but re-size the graph
> itself)

Programs like irfanview can do batch resizing. Resize before, don't do it 
on-the-fly.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Thu, 24 Feb 2005 08:53:31 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Read from keyboard
Message-Id: <cvk16t$6as$1@nntp.fujitsu-siemens.com>

jl_post@hotmail.com wrote:
> * Tong * wrote:
>=20
>>Is there any way to read from keyboard/tty instead of STDIN?
>>
>>My script process STDIN, while some time it need user interaction
>=20
> through
>=20
>>the keyboard, leaving the STDIN intact.
>>
>>I've tried the getc(), and Term::ReadKey. However, they all seems to
>=20
> read
>=20
>>from STDIN. Please help.
>=20
>=20
>=20
> Dear Tong,
>=20
>    This may not be the answer you're looking for, but did you try
> reading all of STDIN first BEFORE requiring user interaction?
>=20
> For example, if you wanted to ask a user his/her name, you might try
> something like this:
>=20
>       my @allLinesFromSTDIN =3D <>;
>       print "What is your name? ";
>       my $name =3D <STDIN>;  # don't forget to chomp() !
>=20
> The first line reads all immediate lines from STDIN into an array,
> leaving all subsequent reads from STDIN free to read from user input.
> You are then free to process all the immediate STDIN lines later with
> code like:
>=20
>       foreach (@allLinesFromSTDIN)  # instead of "foreach(<>)"
>       {
>          # The $_ holds a line of input.
>          # Process $_ here...
>       }
>=20
>    I hope this helps, Tong.

No, it won't. You did try your solution? What happened?
I tried, and it didn't work.

When you have read all of STDIN, any subsequent read will return EOF.=20
There is no magic that re-opens any terminal the process might (or might =

not) be connected to.
Imagine what happens if you run a program in the background which has=20
STDIN redirected to a file and which reads until EOF is detected and=20
then more! According to your logic, it will start to read from the=20
keyboard, completely confusing everything.

The direct solution to Tong's question is operating system dependent.=20
Unter Unix/Linux, Chris' suggestion of (re-) opening "/dev/tty" is=20
obviously a valid solution (afair, this is how programs like "cpio" work =

when requiring user interaction). Under another OS, (re-) opening "CON:" =

might work.
IMHO a much better solution is to avoid redirection of STDIN and require =

the input file to be passed as an argument. It should even work with the =

often used '-' as a command-line argument, as this (re-) opens STDIN,=20
which is what you want in that case, however, making the mixed=20
file-/user-input impossible.

Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: 23 Feb 2005 22:09:05 -0500
From: strangeman@strangecomputer.org
Subject: Re: Reading compressed file and its conversion to numbers.
Message-Id: <87ll9ek626.fsf@Knoppix.i-did-not-set--mail-host-address--so-shoot-me>

"jl_post@hotmail.com" <jl_post@hotmail.com> writes:

 Because of deep computational truths, I had to separate the number with _.
 This allowed me to pack and unpack precisely.
 Thanks a lot.

  Henry 


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

Date: 24 Feb 2005 07:00:18 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regexp
Message-Id: <cvju22$qed$1@mamenchi.zrz.TU-Berlin.DE>

Abigail  <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> 
> I'd write it as:
> 
>     $loop_hs =~ s/\$(?=HTML{'$noteval'}/*/g;

You'd close the parenthesis:

    $loop_hs =~ s/\$(?=HTML{'$noteval'})/*/g;

Anno


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

Date: Wed, 23 Feb 2005 22:00:33 -0700
From: "Robin" <webmaster @ infusedlight.net>
Subject: testing
Message-Id: <U-ednb3NkZMRw4DfRVn-gQ@comcast.com>



-- 
Robin
--
webmaster@infusedlight.net
-- 




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

Date: Thu, 24 Feb 2005 06:25:57 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: testing
Message-Id: <slrnd1qsrl.2t3.dha@panix2.panix.com>

On 2005-02-24, Robin <webmaster@infusedlight.net> wrote:
>

You should use test newsgroups for testing. That's why they're called
that. :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"...who could save journalists a lot of trouble by adopting "not related"
as his middle name..."
   - A. O. Scott, on Kiyoshi Kurosawa, in the NY Times


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

Date: Thu, 24 Feb 2005 06:39:59 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: testing
Message-Id: <3FeTd.51304$Dc.35539@trnddc06>

Robin wrote:
[nothing]

Do you have a contribution about Perl, too?

jue 




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

Date: Wed, 23 Feb 2005 20:23:46 -0500
From: Wes Groleau <groleau+news@freeshell.org>
Subject: Re: unicode: =?UTF-8?B?w6k9PmUsIMOhPT5h?=
Message-Id: <384oktF5ikf4pU1@individual.net>

Calle Dybedahl wrote:
> No, that would be worse. If you just remove the characters that can't
> be displayed (preferably replacing them with question marks or
> something similar), it's obvious that your text has been changed. If
> you try to remove what you think are accents you are quite likely to
> inadvertently change the meaning of the text. For example, in Swedish
> text you would change the word for "to hear" ("höra") to the word for
> "whore" ("hora"). In any reasonably professional context this will
> very rarely be to your advantage.

Or in Spanish, you might change
"Tengo veinte años" (I'm twenty years old) to
"Tengo veinte anos" (I have twenty anuses).

On the other hand, I would think that people
who use terminals/systems not capable of displaying
diacritics would be well-accustomed to seeing such
"errors."  _Especially_ since so many people who
ARE capable of handling them are too lazy to do so
or just plain don't know how.

-- 
Wes Groleau

  Guidelines for judging others:

  1. Don't attribute to malice that which
     can be adequately explained by stupidity.

  2. Don't attribute to stupidity that which
     can be adequately explained by ignorance.

  3. Don't attribute to ignorance that which
     can be adequately explained by misunderstanding.


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

Date: 23 Feb 2005 22:26:00 -0500
From: strangeuser@strangesomputer.com
Subject: Why declare "my $something" on top if it's going to get a lexical scope in a subroutine?
Message-Id: <87fyzmk59z.fsf@Knoppix.i-did-not-set--mail-host-address--so-shoot-me>


Hi -- 

 I've read some explanations in the Camel book, but this error is puzzling me:

 ------------------------------
code
-----------------------------

#!/usr/bin/perl

use warnings;
use strict;

system("clear");

our $FileName;
our @File;
our @Card;


_enterCard();

my $hex = _transformToHex(@Card);
print "$hex\n";

sub _enterCard
{ #write the biblographic card 
    print "AUTHOR(S)= "; my $authors = <>; 
    print "TITLE= "; my $title = <>;
    print "KEYWORDS= "; my $keywords = <>;
    print "SOURCE/JOURNAL= "; my $source = <>;
    print "VOL= "; my $vol = <>;
    print "YEAR= "; my $year = <>;
    print "PAGES= "; my $pages = <>;
    print "EDITOR= "; my $editor = <>;
    print "ETC= "; my $etc = <>;
    print "X-REF= "; my $xref = <>;

    $authors = "AUTHOR(S)= $authors";
    $title =  "TITLE= $title";
    $keywords = "KEYWORDS= $keywords";
    $source = "SOURCE/JOURNAL= $source";
    $vol = "VOL= $vol";
    $year = "YEAR= $year";
    $pages = "PAGES= $pages";
    $editor = "EDITOR= $editor";
    $etc =  "ETC= $etc";
    $xref = "X-REF= $xref";

  
    @Card=($authors, $title, $keywords, $source, $vol, $year, $pages, $editor, $etc, $xref);
    print "\n\n@Card\n";

}


sub _transformToHex  {
    my @data = @_
    my $hex = unpack("H*", join('_', @data));
    #print "$hex\n";
    return $hex;
}

----------------------
end code
----------------------

----------------------
error
----------------------

$ perl writeFile.pl
syntax error at writeFile.pl line 51, near "@_
    my "
Global symbol "@data" requires explicit package name at writeFile.pl line 51.
Execution of writeFile.pl aborted due to compilation errors.
----------------------
end error
---------------------

 The data (@Card) was passed to the argument stack (@_) via a subroutine and
it was bound locally (that is, in the block lexical scope) to @data. 
 Of course, simply appending "my @data;" at the beginning of the script
(next to "our (etc..)") would resolve the error.
 But why do you have to do that, since we declare "my @data" inside a sub
routine block?
 I don't understand this...


 Any comment on what the issue is is appreciated.
 TIA.
 
 Henry Lenzi



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

Date: Thu, 24 Feb 2005 03:58:46 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Why declare "my $something" on top if it's going to get a lexical scope in a subroutine?
Message-Id: <WhcTd.173142$K7.104440@news-server.bigpond.net.au>

<strangeuser@strangesomputer.com> wrote in message
news:87fyzmk59z.fsf@Knoppix.i-did-not-set--mail-host-address--so-shoot-me...
>
> Hi -- 
>
>  I've read some explanations in the Camel book, but this error is puzzling
me:
>
> sub _transformToHex  {
>     my @data = @_

missing colon after @_ means this line does not parse. (hence @data is not
declared, which causes the second error)  Insert the ; and the second error
will disappear too...

>     my $hex = unpack("H*", join('_', @data));
>     #print "$hex\n";
>     return $hex;
> }

<snip>

> $ perl writeFile.pl
> syntax error at writeFile.pl line 51, near "@_
>     my "
> Global symbol "@data" requires explicit package name at writeFile.pl line
51.
> Execution of writeFile.pl aborted due to compilation errors.

fix the errors in the order they appear (generally).  Often subsequent
errors are caused by previous ones, especially missing ;.  Once those are
fixed, the rest often are fixed too..

P
-- 




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

Date: Wed, 23 Feb 2005 22:58:14 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Why declare "my $something" on top if it's going to get a lexical scope in a subroutine?
Message-Id: <slrnd1qnn6.7fp.tadmc@magna.augustmail.com>

strangeuser@strangesomputer.com <strangeuser@strangesomputer.com> wrote:

>  I've read some explanations in the Camel book, but this error is puzzling me:


You are missing a semicolon.


> our $FileName;
> our @File;
> our @Card;


Why are you using package variables instead of lexical variables?


> sub _enterCard
> { #write the biblographic card 
>     print "AUTHOR(S)= "; my $authors = <>; 
>     print "TITLE= "; my $title = <>;
>     print "KEYWORDS= "; my $keywords = <>;
>     print "SOURCE/JOURNAL= "; my $source = <>;
>     print "VOL= "; my $vol = <>;
>     print "YEAR= "; my $year = <>;
>     print "PAGES= "; my $pages = <>;
>     print "EDITOR= "; my $editor = <>;
>     print "ETC= "; my $etc = <>;
>     print "X-REF= "; my $xref = <>;
> 
>     $authors = "AUTHOR(S)= $authors";
>     $title =  "TITLE= $title";
>     $keywords = "KEYWORDS= $keywords";
>     $source = "SOURCE/JOURNAL= $source";
>     $vol = "VOL= $vol";
>     $year = "YEAR= $year";
>     $pages = "PAGES= $pages";
>     $editor = "EDITOR= $editor";
>     $etc =  "ETC= $etc";
>     $xref = "X-REF= $xref";
> 
>   
>     @Card=($authors, $title, $keywords, $source, $vol, $year, $pages, $editor, $etc, $xref);
>     print "\n\n@Card\n";
> 
> }


You can rewrite that to elimintate a lot of the repetitive code
using a "hash slice":

   sub _enterCard {  # untested!
      my %items;
      my @fields = qw/ AUTHOR(S)  TITLE   KEYWORDS
                       SOURCE/JOURNAL   VOL   YEAR
                       PAGES   EDITOR   ETC   X-REF
                     /;

      foreach my $prompt ( @fields ) {
         print "$prompt= ";
         $item{$prompt} = $prompt . <STDIN>;
      }

      @Card = @items{ @fields };
   }


> sub _transformToHex  {
>     my @data = @_


Where's the semicolon?


> $ perl writeFile.pl
> syntax error at writeFile.pl line 51, near "@_


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


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

Date: Thu, 24 Feb 2005 09:46:56 +0800
From: GreenLeaf <newspost@kohomban.net>
Subject: Re: Why declare "my $something" on top if it's going to get a lexical scope in a subroutine?
Message-Id: <384q2rF5gc7n0U2@individual.net>

strangeuser@strangesomputer.com wrote:

<code snipped>

> sub _transformToHex  {
>     my @data = @_

>  But why do you have to do that, since we declare "my @data" inside a sub
> routine block?
>  I don't understand this...

Error is due to the missing semicolon after @_. Perl clearly says there 
is a syntax error there. I, as a newbie, have seen that it helps to 
correct errors in the order they appear, especially when it comes to 
syntax errors. :)

Hope this helps,
sat


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

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 7822
***************************************


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