[29926] in Perl-Users-Digest
Perl-Users Digest, Issue: 1169 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 3 21:53:45 2008
Date: Thu, 3 Jan 2008 11:14:10 -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, 3 Jan 2008 Volume: 11 Number: 1169
Today's topics:
odd file with ^@ characters cartercc@gmail.com
Re: odd file with ^@ characters <peter@makholm.net>
Re: odd file with ^@ characters <jurgenex@hotmail.com>
Re: Perl - no longer open source and facing extinction <daves@orpheusmail.co.uk>
Re: Perl - no longer open source and facing extinction <sigzero@gmail.com>
Re: Perl - no longer open source and facing extinction <purlgurl@purlgurl.net>
Re: Perl - no longer open source and facing extinction <john@castleamber.com>
Re: Perl - no longer open source and facing extinction <john@castleamber.com>
Re: Perl - no longer open source and facing extinction <sigzero@gmail.com>
Perl memory manager <nishant.031@gmail.com>
Re: Perl memory manager <joost@zeekat.nl>
problem when submitting a string through a form <nikos1337@gmail.com>
Re: problem when submitting a string through a form <mritty@gmail.com>
Re: problem when submitting a string through a form <nikos1337@gmail.com>
Re: problem when submitting a string through a form <nikos1337@gmail.com>
Re: problem when submitting a string through a form <RedGrittyBrick@SpamWeary.foo>
Re: problem when submitting a string through a form <nikos1337@gmail.com>
Re: Why does undef->{id} give a warning and $undefined_ <tadmc@seesig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 3 Jan 2008 10:08:45 -0800 (PST)
From: cartercc@gmail.com
Subject: odd file with ^@ characters
Message-Id: <f7ce0b01-bdec-43c4-a6f7-0aedb79efe9d@i7g2000prf.googlegroups.com>
I was given an odd CVS file this morning, with datafields delimited by
",". I do not know the provenance, and neither does the person who
gave it to me. It's a data file with 1279 rows and size is 11M that
contains data for an urgent report, and the target system is Windows.
Neither Excel nor Access will take the file, but it opens up fine in
with cat, head, etc.
I moved the file to my Unix system and looked at it in vi. This is
what it looks like, for example, 'perl is good' looks like this:
^@p^@e^@r^@l^@ ^@i^@s^@ ^@g^@o^@o^@d
When I open up the output file in windows, I either get the ? or the
square unrecognizible character symbols.
I ~think~ I know what the problem is, but I haven't found the answer.
Here are some of the things I've tried. The best result is a file with
ASCII characters but with large strings of ?????????????????? at the
end of each line. Is this an encoding problem? and if so, how do I
convert the characters into plain ASCII that Excel or Access will
accept?
Thanks, CC
(code follows)
#!/usr/bin/perl -w
use strict;
use Encode; #tried various decode functions, also binmode
#open INFILE, "<BB.TXT";
open INFILE, "<:utf8", 'BB.TXT';
open OUTFILE, ">:utf8", 'cleanBB.txt';
while (<INFILE>)
{
# print $_;
my $line = $_;
# $line = decode_utf8($line);
# $line =~ s/\x{0000}//g;
# $line =~ s/<.*>//g;
$line =~ s/[^[:ascii:]]+//g;
$line =~ s/<(.*)>//g; #removed file data between <>, not HTML.
print OUTFILE $line;
}
close INFILE;
close OUTFILE;
------------------------------
Date: Thu, 03 Jan 2008 18:30:01 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: odd file with ^@ characters
Message-Id: <87r6gyzrrq.fsf@hacking.dk>
cartercc@gmail.com writes:
> I moved the file to my Unix system and looked at it in vi. This is
> what it looks like, for example, 'perl is good' looks like this:
> ^@p^@e^@r^@l^@ ^@i^@s^@ ^@g^@o^@o^@d
Could be UTF-16BE or UCS-2BE.
//Makholm
------------------------------
Date: Thu, 03 Jan 2008 18:38:08 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: odd file with ^@ characters
Message-Id: <hv9qn394ae5vn7ru47182j36ndmojs39cl@4ax.com>
cartercc@gmail.com wrote:
>I was given an odd CVS file this morning, with datafields delimited by
>",". I do not know the provenance, and neither does the person who
>gave it to me. It's a data file with 1279 rows and size is 11M that
>contains data for an urgent report, and the target system is Windows.
>Neither Excel nor Access will take the file, but it opens up fine in
>with cat, head, etc.
>
>I moved the file to my Unix system and looked at it in vi. This is
>what it looks like, for example, 'perl is good' looks like this:
>^@p^@e^@r^@l^@ ^@i^@s^@ ^@g^@o^@o^@d
Nothing do to with Perl but it appears as if the file is encoded in a 16-bit
encoding, most likely UTF-16.
>When I open up the output file in windows, I either get the ? or the
>square unrecognizible character symbols.
This may or may not work: Try opening the file in Firefox (yes, in a web
browser), and change "View -> Encoding -> More" to Unicode(UTF16).
This should give you a readable display which then you can either
copy-and-paste or even Save-As in a different encoding that is compatible
with your other tools.
Another option: Windows tools have the habit of adding a byte order mark
(BOM) to any Unicode file, no matter if its needed or not. Maybe it's just
that whatever program created that file did not write the BOM and therefore
the Windows programs don't recognize the encoding.
If that is the case you could use your favourite editor to just inject the
BOM at the beginning of the file.
jue
>
>I ~think~ I know what the problem is, but I haven't found the answer.
>Here are some of the things I've tried. The best result is a file with
>ASCII characters but with large strings of ?????????????????? at the
>end of each line. Is this an encoding problem? and if so, how do I
>convert the characters into plain ASCII that Excel or Access will
>accept?
>
>Thanks, CC
>(code follows)
>
>#!/usr/bin/perl -w
>use strict;
>use Encode; #tried various decode functions, also binmode
>
>#open INFILE, "<BB.TXT";
>open INFILE, "<:utf8", 'BB.TXT';
>open OUTFILE, ">:utf8", 'cleanBB.txt';
>
>while (<INFILE>)
>{
># print $_;
> my $line = $_;
># $line = decode_utf8($line);
># $line =~ s/\x{0000}//g;
># $line =~ s/<.*>//g;
> $line =~ s/[^[:ascii:]]+//g;
> $line =~ s/<(.*)>//g; #removed file data between <>, not HTML.
> print OUTFILE $line;
>}
>close INFILE;
>close OUTFILE;
------------------------------
Date: Thu, 03 Jan 2008 12:03:16 +0000 (GMT)
From: Dave Stratford <daves@orpheusmail.co.uk>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <4f5b5a47b4daves@orpheusmail.co.uk>
In article <Xns9A196B473C21Dcastleamber@130.133.1.4>,
John Bokma <john@castleamber.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
> > On 2008-01-02 00:04, John Bokma <john@castleamber.com> wrote:
> >> Purl Gurl <purlgurl@purlgurl.net> wrote:
> >>> Perl is now an antiquated collector's item laid to rest upon
> >>> a shelf to collect dust and cobwebs.
> > [...]
> >> Also Linux Journal (IIRC) and Linux Magazine (for sure) publish often
> >> enough solid articles written by excellent writers (Hi Randal, Hi
> >> chromatic). Why would a magazine waste space on a dead language?
> >>
> >
> > Because Linux is obsolete, too?
> >
> > SCNR,
> > hp
> :-D. Let's hope not, I mean I am just about to switch entirely away from
> Windows.
With all due respect, and without in any way either agreeing or
disagreeing with the statement that Linux is obsolete, can I point out
that just because something is better than windows, which linux for the
most part patently is, does not prevent it, linux in this example, from
being obsolete.
Dave
--
Dave Stratford ZFCA
http://daves.orpheusweb.co.uk/
Hexagon Systems Limited - Experts in VME systems development
------------------------------
Date: Thu, 3 Jan 2008 07:36:01 -0800 (PST)
From: Robert Hicks <sigzero@gmail.com>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <487fee6b-e4a4-428f-9626-ab0724c7d444@d4g2000prg.googlegroups.com>
On Jan 3, 6:02 am, sourceview <sourcevi...@gmail.com> wrote:
> On Dec 31 2007, 4:20 pm, Purl Gurl <purlg...@purlgurl.net> wrote:
>
>
>
> > I am noting the continued demise of Perl programming.
>
> > Participation within this group is down about seventy-five
> > percent from traditional historical averages. The new
> > "perl.beginners" groups are the verge of extinction.
>
> > Of interest to me is the policy of "banishment" by the
> > Perl beginners groups. The main group, perl.beginners,
> > participation is cut in half and more since a banishment
> > policy has been effected. The beginners cgi group is down
> > to a near zero participation level.
>
> > Perl was once anopensourceprogramming language. Today,
> > this is not true. Many proficient Perl programmers are no
> > longer allowed to participate in discussions of Perl. This,
> > of course, does contribute to the demise of Perl programming.
>
> > Looks to me a select few are converting Perl into a "closedsource"
> > programming language, this is, only allowing a select few to
> > continue participating in discussions of and development of
> > the Perl programming language.
>
> > Rather sad to watch a once thriving community of Perl programmers
> > degrade into a Good Ol' Boys club which shuns all but a very
> > select few.
>
> > This banishment policy is the expected outcome of what I have
> > noted for years; the Perl Community is a very hostile community.
>
> > Couple more years, Perl will be extinct and you select few
> > Good Ol' Boys will have Perl all to yourselves, as you intend.
>
> > Got Perl 6?
>
> > --
> > Purl Gurl
> > --
> > So many are stumped by what slips right off the top of my mind
> > like a man's bad fitting hairpiece.
>
> so much poison, and all over a free language???
Yes and it's painfully obvious she has no clue what she is talking
about.
------------------------------
Date: Thu, 03 Jan 2008 07:49:27 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <E56dnVY6d7KXmeDanZ2dnUVZ_q-jnZ2d@giganews.com>
Robert Hicks wrote:
>> Purl Gurl wrote:
(snipped to the point)
>>> I am noting the continued demise of Perl programming.
> Yes and it's painfully obvious she has no clue what she is talking
> about.
Thus far, almost all commentary on this topic coming
out of the Perl Community consists of childish personal
insults. You boys serve well to exemplify and highlight
the Perl Community is a Good Ol' Boys club populated by
poorly educated near illiterates.
In view of this high level of ignorance and significant
evidence of educational lacking amongst those of the
Perl Community, there is no surprise Perl is dying.
--
Purl Gurl
--
So many are stumped by what slips right off the top of my mind
like a man's bad fitting hairpiece.
------------------------------
Date: 3 Jan 2008 18:00:04 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <Xns9A1A7A1545F09castleamber@130.133.1.4>
"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
> "Linux is obsolete" was the subject of a usenet posting by Andrew
> Tanenbaum in 1992.
Oh, I am well aware of that. I saw Linus at the University of Utrecht back
in 1994 or so. About the same time I was pondering if it was possible to
port GNU/Linux to the Acorn Archimedes :-D. (Some GNU software already ran
on RISC OS, and I made my first Perl programs on an Acorn Archimedes.
> Amongst old-time linuxers it has become a running gag
> of sorts.
I am afraid that a lot of people who consider it a gag, don't understand
both sides of the argument equally well, but see it as pwnage.
--
John
Arachnids near Coyolillo - part 1
http://johnbokma.com/mexit/2006/05/04/arachnids-coyolillo-1.html
------------------------------
Date: 3 Jan 2008 18:01:37 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <Xns9A1A7A5884656castleamber@130.133.1.4>
Dave Stratford <daves@orpheusmail.co.uk> wrote:
> With all due respect, and without in any way either agreeing or
> disagreeing with the statement that Linux is obsolete, can I point out
> that just because something is better than windows, which linux for
> the most part patently is, does not prevent it, linux in this example,
> from being obsolete.
Uhm, you have a point :-).
--
John
Arachnids near Coyolillo - part 1
http://johnbokma.com/mexit/2006/05/04/arachnids-coyolillo-1.html
------------------------------
Date: Thu, 3 Jan 2008 10:32:46 -0800 (PST)
From: Robert Hicks <sigzero@gmail.com>
Subject: Re: Perl - no longer open source and facing extinction
Message-Id: <803f7e7e-82b9-4b03-98be-4766d072e5f4@p31g2000hsd.googlegroups.com>
On Jan 3, 10:49=A0am, Purl Gurl <purlg...@purlgurl.net> wrote:
> Robert Hicks wrote:
> >> Purl Gurl wrote:
>
> (snipped to the point)
>
> >>> I am noting the continued demise of Perl programming.
> > Yes and it's painfully obvious she has no clue what she is talking
> > about.
>
> Thus far, almost all commentary on this topic coming
> out of the Perl Community consists of childish personal
> insults. You boys serve well to exemplify and highlight
> the Perl Community is a Good Ol' Boys club populated by
> poorly educated near illiterates.
>
> In view of this high level of ignorance and significant
> evidence of educational lacking amongst those of the
> Perl Community, there is no surprise Perl is dying.
>
> --
> Purl Gurl
> --
> So many are stumped by what slips right off the top of my mind
> like a man's bad fitting hairpiece.
You are entertaining, I will give you that. Clueless but entertaining.
------------------------------
Date: Thu, 3 Jan 2008 04:26:39 -0800 (PST)
From: Nishant <nishant.031@gmail.com>
Subject: Perl memory manager
Message-Id: <ebe644b7-62d8-463f-b378-097d8a366bed@i12g2000prf.googlegroups.com>
Hi ,
My understanding about the perl memory manager is that it initially
allocates a chunk of memory and allocates more memory when required.
but it does not return the whole memory to the OS. Rather, it keeps it
with itself ,so that the next time it has to use memory , it can use
it from the already chunk of memory that it has. Is my understanding
correct ? If yes, in what all scenarios does perl return memory back
to OS and scenarios in which it does not return.
Also, what is the size of the chunk of the memory that perl allocates
at one time. Is it variable ?
Regards
Nishant Sharma
------------------------------
Date: Thu, 03 Jan 2008 15:35:30 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: Perl memory manager
Message-Id: <87odc3x9hp.fsf@zeekat.nl>
Nishant <nishant.031@gmail.com> writes:
> Hi ,
> My understanding about the perl memory manager is that it initially
> allocates a chunk of memory and allocates more memory when required.
> but it does not return the whole memory to the OS. Rather, it keeps it
> with itself ,so that the next time it has to use memory , it can use
> it from the already chunk of memory that it has. Is my understanding
> correct ?
In general, yes, your understanding is correct.
> If yes, in what all scenarios does perl return memory back
> to OS and scenarios in which it does not return.
In my experience it depends on the OS and possibly also on the malloc
implementation that your perl interpreter is configured with.
As a quick guideline you should assume *no* memory is ever returned to
the OS except when the program exits or is replaced by another program
via exec.
In certain cases you can get memory back to the OS by just letting
variables go out of scope, for instance:
for (@someting) {
my @x = some_really_long_strings();
}
may or may not release @x's memory to the OS when the loop is done.
Sometimes explicitly undefining collections works when scoping by itself
doesn't:
my @x;
for (@someting) {
@x = some_really_long_strings();
}
undef @x;
This works at least in some cases on some versions of perl on some linux
systems. You'll just have to test it yourself to be sure.
> Also, what is the size of the chunk of the memory that perl allocates
> at one time. Is it variable ?
I'm pretty sure it's variable. Allocating hundreds of small chunks just
to get a single big chunk would be stupid. Things like arrays, strings
and hashes all need continous chunks of memory of unpredictable sizes.
Joost.
------------------------------
Date: Thu, 3 Jan 2008 04:51:42 -0800 (PST)
From: Nikos <nikos1337@gmail.com>
Subject: problem when submitting a string through a form
Message-Id: <3775939c-d029-43b7-b034-0be793043d78@i29g2000prf.googlegroups.com>
Hello, iam havign an issue about a string that when is submittd
through a form in index.pl doesnt get back the same as the original
you can read here so i wont type everythign form beginning please.
PerlMonks tried to help me (well 1 of them actuall) but i didnt came
to a final conclusion as to whats going on and how to correct it.
------------------------------
Date: Thu, 3 Jan 2008 05:06:44 -0800 (PST)
From: Paul Lalli <mritty@gmail.com>
Subject: Re: problem when submitting a string through a form
Message-Id: <7b98c8fc-6425-4041-891e-c7d9ae273886@e6g2000prf.googlegroups.com>
On Jan 3, 7:51=A0am, Nikos <nikos1...@gmail.com> wrote:
> Hello, iam havign an issue about a string that when is submittd
> through a form in index.pl doesnt get back the same as the original
>
> you can read here so i wont type everythign form beginning please.
We can't read anything you don't give us. If you think you put in a
hyperlink there, you didn't. Usenet is text only.
Paul Lalli
------------------------------
Date: Thu, 3 Jan 2008 05:13:47 -0800 (PST)
From: Nikos <nikos1337@gmail.com>
Subject: Re: problem when submitting a string through a form
Message-Id: <b32f317c-8647-4304-bf1d-2fa697eee778@l6g2000prm.googlegroups.com>
On 3 =C9=E1=ED, 15:06, Paul Lalli <mri...@gmail.com> wrote:
> We can't read anything you don't give us. =A0If you think you put in a
> hyperlink there, you didn't. =A0Usenet is text only.
Ah, sorry Paul here is the the link(had it in mind but forgo to attach
it): http://perlmonks.org/?node_id=3D659466
------------------------------
Date: Thu, 3 Jan 2008 08:46:46 -0800 (PST)
From: Nikos <nikos1337@gmail.com>
Subject: Re: problem when submitting a string through a form
Message-Id: <a8cebc80-0e84-4d69-ac30-6ac57f01050b@d4g2000prg.googlegroups.com>
Did anyone read the link? if you want i can also explaint he peroblem
here.
------------------------------
Date: 03 Jan 2008 17:07:40 GMT
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: problem when submitting a string through a form
Message-Id: <477d165c$0$13936$fa0fcedb@news.zen.co.uk>
Nikos wrote:
> Did anyone read the link? if you want i can also explaint he peroblem
> here.
I did but there was insufficient information for me to comment. You
didn't post a complete program nor the HTML of the form which invoked
the program.
I suspect that printing* the value of param('select') in the else clause
will shed some light on the problem. It wouldn't hurt to print
@display_files too.
Maybe some values need chomping.
* I'd use Data::Dumper or carefully quote the values to look for
extraneous whitespace etc;
------------------------------
Date: Thu, 3 Jan 2008 10:00:22 -0800 (PST)
From: Nikos <nikos1337@gmail.com>
Subject: Re: problem when submitting a string through a form
Message-Id: <d220b197-5d2f-4c86-9849-d313217d0354@i29g2000prf.googlegroups.com>
Here is index.pl as it is now: you can view it at http://nikos.no-ip.org
if you want
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use DBI;
use POSIX qw(strftime);
use Encode;
my ($select, $article, $row, $data);
my $date =3D strftime('%y-%m-%d %H:%M:%S', localtime);
my $display_date =3D strftime('%a %d %b, %I:%M %p', localtime);
Encode::from_to($display_date, 'ISO-8859-7', 'utf8');
my $host =3D gethostbyaddr (pack ("C4", split (/\./,
$ENV{'REMOTE_ADDR'})), 2) || $ENV{REMOTE_ADDR};
$host =3D "Administrator" if ( ($host =3D~ /dell/) or ($host =3D~ /
localhost/) );
#=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=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
my $db =3D ( $ENV{'SERVER_NAME'} !~ /varsa/ )
? DBI->connect('DBI:mysql:orthodox;localhost', 'root', '*****',
{RaiseError=3D>1})
: DBI->connect('DBI:mysql:nikosva_orthodox;www.freegreece.net',
'nikosva_nikos', '****', {RaiseError=3D>1});
#=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=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
print header( -charset=3D>'utf-8' );
my $article =3D param('select') || "=C1=F1=F7=E9=EA=DE =D3=E5=EB=DF=E4=E1!";=
my @files =3D glob "$ENV{'DOCUMENT_ROOT'}/data/text/*.txt";
my @display_files =3D map m{([^/]+)\.txt}, @files;
Encode::from_to($_, 'ISO-8859-7', 'utf8') for @display_files;
if ( param('select') ) { #If user selected an item from the drop
down menu
unless ( grep { $_ eq param('select') } @display_files ) #Unless
user selection doesn't match one of the valid filenames within
@display_files
{
if( param('select') =3D~ /\0/ )
{
$article =3D "*Null Byte Injection* attempted & logged!";
print br() x 2, h1( {class=3D>'big'}, $article );
}
if( param('select') =3D~ /\/\.\./ )
{
$article =3D "*Backwards Directory Traversal* attempted &
logged!";
print br() x 2, h1( {class=3D>'big'}, $article );
}
$select =3D $db->prepare( "UPDATE guestlog SET article=3D?, date=3D?,
counter=3Dcounter+1 WHERE host=3D?" );
$select->execute( $article, $date, $host );
exit 0;
}
$article =3D decode('utf8', param('select' ));
Encode::from_to($article, 'utf8', 'ISO-8859-7');
open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/text/$article.txt" or die
$!;
local $/;
$data =3D <FILE>;
close FILE;
$select =3D $db->prepare( "UPDATE guestlog SET article=3D?, date=3D?,
counter=3Dcounter+1 WHERE host=3D?" );
$select->execute( $article, $date, $host );
}
else {
$select =3D $db->prepare( "SELECT host FROM guestlog WHERE host=3D?" );
$select->execute( $host );
if ($select->rows)
{
$select =3D $db->prepare( "SELECT host, DATE_FORMAT(date, '%a %d
%b, %h:%i') AS date, counter, article FROM guestlog WHERE host=3D?" );
$select->execute( $host );
$row =3D $select->fetchrow_hashref;
$data =3D "=CA=E1=EB=FE=F2 =DE=EB=E8=E5=F2 $host! =D7=E1=DF=F1=EF=EC=
=E1=E9 =F0=EF=F5 =E2=F1=DF=F3=EA=E5=E9=F2 =F4=E7=ED =F3=E5=EB=DF=E4=E1
=E5=ED=E4=E9=E1=F6=DD=F1=EF=F5=F3=E1.
=D4=E5=EB=E5=F5=F4=E1=DF=E1 =F6=EF=F1=DC =DE=F1=E8=E5=F2 =E5=
=E4=FE =F9=F2 $row->{host} =F3=F4=E9=F2 $row-
>{date} !
=D0=F1=EF=E7=E3=EF=FD=EC=E5=ED=EF=F2 =E1=F1=E9=E8=EC=FE=ED =
=E5=F0=E9=F3=EA=DD=F8=E5=F9=ED =3D> $row->{counter}
=D4=E5=EB=E5=F5=F4=E1=DF=E1 =E5=DF=E4=E5=F2 =F4=EF =EA=E5=DF=
=EC=E5=ED=EF [ $row->{article} ]
=D0=EF=E9=FC =EA=E5=DF=EC=E5=ED=EF =E8=E1 =EC=E5=EB=E5=F4=DE=
=F3=E5=E9=F2 =E1=F5=F4=DE=ED =F4=E7=ED =F6=EF=F1=DC !?";
$select =3D $db->prepare( "UPDATE guestlog SET date=3D?,
counter=3Dcounter+1 WHERE host=3D?" );
$select->execute( $date, $host );
}
else
{
if ($host eq "Administrator") {
$data =3D "=C3=E5=E9=DC =F3=EF=F5 =CD=E9=EA=FC=EB=E1! =D0=FE=F2 =F0=
=DC=ED=E5 =F4=E1 =EA=DD=F6=E9=E1? ;-)";
}
else {
$data =3D "=C3=E5=E9=DC =F3=EF=F5 $host!
=B8=F1=F7=E5=F3=E1=E9 =E3=E9=E1 1=E7 =F6=EF=F1=DC =E5=E4=
=FE !!
=C5=EB=F0=DF=E6=F9 =ED=E1 =E2=F1=E5=DF=F2 =F4=E1 =EA=E5=DF=
=EC=E5=ED=E1 =E5=ED=E4=E9=E1=F6=DD=F1=EF=ED=F4=E1 :-)";
}
unless ($host eq "Administrator") {
$select =3D $db->prepare( "INSERT INTO guestlog (host, date,
article, counter) VALUES (?, ?, ?, ?)" );
$select->execute( $host, $date, $article, 1 );
}
}
}
for ($data) {
s/\n/\\n/g;
s/"/\\"/g;
tr/\cM//d;
}
#=3D=3D=3D=3D=3D=3DOK, $data set up. Now print header, start_html and JavaSc=
ript
stuff=3D=3D=3D=3D=3D=3D
print
start_html(
-script =3D> [
"var textToShow =3D '$data';",
{
-language =3D> 'JAVASCRIPT',
-src =3D> '/data/scripts/char_by_char.js'
}
],
-style =3D> '/data/scripts/style.css',
-title =3D> '=CF=F1=E8=FC=E4=EF=EE=E1 =D0=ED=E5=F5=EC=E1=F4=E9=EA=DC =C8=
=DD=EC=E1=F4=E1!',
-onload =3D> 'init();'
),
a({href=3D>'/cgi-bin/register.pl'}, img{src=3D>'/data/images/reg.jpg'}),
start_form(action=3D>'/cgi-bin/index.pl'),
h1({class=3D>'lime'}, "=C5=F0=DD=EB=E5=EE=E5 =F4=EF =EA=E5=DF=EC=E5=ED=EF =
=F0=EF=F5 =F3=E5 =E5=ED=E4=E9=E1=F6=DD=F1=E5=E9 =3D> ",
popup_menu( -name=3D>'select', -values=3D>
\@display_files ),
submit(-label=3D>'ok')),
end_form,
div({id =3D> "DivText"}),
end_html;
#=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=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
The problem is that when the user selects something from my popup
menu(one string) and then submits it, the returned string being sent
back to my index.pl ain't matching this line: unless ( grep { $_ eq
param('select') } @display_files )
and that fact led to believe that the browser or something else
somehow malformes the original value(the one selected before
submission)
I though that this line would take care of the problem coverting it
properly to utf8 but it doesnt :(
$article =3D decode('utf8', param('select' ));
please help
------------------------------
Date: Thu, 3 Jan 2008 05:54:46 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Why does undef->{id} give a warning and $undefined_var->{id} doesn't
Message-Id: <slrnfnpj86.cip.tadmc@tadmc30.sbcglobal.net>
himanshu.garg@gmail.com <himanshu.garg@gmail.com> wrote:
> Subject: Why does undef->{id} give a warning and $undefined_var->{id} doesn't
Because of autovivification.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
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 V11 Issue 1169
***************************************