[24567] in Perl-Users-Digest
Perl-Users Digest, Issue: 6745 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 14:06:04 2004
Date: Tue, 29 Jun 2004 11:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 29 Jun 2004 Volume: 10 Number: 6745
Today's topics:
CPAN oddities ... wrong charset? <spamtrap@nowhere.com>
Re: Does Perl combine multiple REs into a single automa <clint@0lsen.net>
Re: eof and nested while (<$fh>) {...} (Anno Siegel)
Re: error logs... (Anno Siegel)
Re: error logs... <johnjcarbone@nospam.hotmail.com>
Re: error logs... <johnjcarbone@nospam.hotmail.com>
Re: error logs... <johnjcarbone@nospam.hotmail.com>
Re: error logs... <kkeller-usenet@wombat.san-francisco.ca.us>
Re: How to use 2 DIFFERENT VERSIONS of the SAME MODULE <spikeywan@bigfoot.com.delete.this.bit>
Re: Net::FTP problems getting files from Windows FTP se (D. Buck)
Re: Non-unique columns via ODBC driver ctcgag@hotmail.com
Re: Non-unique columns via ODBC driver <glex_nospam@qwest.invalid>
Nonblocking Pipe Open <nospam@bigpond.com>
Re: Nonblocking Pipe Open <zentara@highstream.net>
Re: PPT UNIX Reconstruction Project at: http://www.perl (Bill)
Re: Setting environment variables from a Perl script (J. Romano)
Re: Setting environment variables from a Perl script <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Strange Behaviour with Hash??? (J. Romano)
tern an hebrew string into unicode (dana livni)
Re: tern an hebrew string into unicode <jurgenex@hotmail.com>
Re: Totally stuck <spamtrap@nowhere.com>
Re: Totally stuck <thundergnat@hotmail.com>
Re: Totally stuck (David Arnold)
Re: undefined subroutine that is defined? mob_perl / p <richard@zync.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Jun 2004 10:59:44 GMT
From: Andrew Lee <spamtrap@nowhere.com>
Subject: CPAN oddities ... wrong charset?
Message-Id: <nji2e05e1taoj70gsi4nr9tdefm4ovpg5t@4ax.com>
Hello,
When trying to install Gisle Aas's remarkably useful Digest::MD5 module I got an
error :
Makefile:85: *** missing separator. Stop.
Indeed, Makefile is hosed ... e.g. :
76 installvendorlib='/usr/lib/perl5/vendor_perl/5.8.
77 INSTALLVENDORLIB = ib/perl5'
78 installusrbinperl='def
79 INSTALLARCHLIB = /usr/lib/perl5/5.8.0/i386-linux-thread-multi
80 INSTALLSITEARCH =
81 INSTALLVENDORARCH = /usr/lib/perl5/vendor_perl/5.8
82 INSTALLBIN = /usr/bin'
83 installhtml1dir=''
84 installhtml3dir=''
85 installman1
86 INSTALLSITEBIN = /usr
?!!?!!!!???
I was succesful in installing other packages -- but I have received this error
(or one like it) on some other packages.
I wonder if my terminal settings are to blame? Something needs to be changed
with the CPAN configuaration?
Any ideas?
TIA
------------------------------
Date: Tue, 29 Jun 2004 16:57:50 GMT
From: Clint Olsen <clint@0lsen.net>
Subject: Re: Does Perl combine multiple REs into a single automaton?
Message-Id: <slrnce37se.1vg.clint@poly.0lsen.net>
On 2004-06-29, Abigail <abigail@abigail.nl> wrote:
>
> No, that would be impossible. First of all, the different patterns may
> contain different set of parens, so $1 and friends would need to be set
> to different things. But more importantly, in the original code, if
> 'pat2' matches, but 'pat' and 'pat1' don't, $_ has been accessed three
> times. And $_ could be tied.
Ok, that makes sense. I didn't think it would be possible to combine them.
It's just that Perl behind the scenes must be doing some sort of weird
execution for these if/else/branches since they are never 'visited' in the
debugger. It just immediately jumps to the code block.
> It *may* be faster to write it as
>
> if (/pat([12]?)/) {
> if ($1 eq "") {...}
> elsif ($1 eq "1") {...}
> else {...}
> }
>
> You'd only use the regex engine was. However, you are using a more
> complicated pattern, and that means the optimizer can do less. Which
> might actually result in a slowdown. You'll have to benchmark to be sure.
I was wondering about that, too - Write a megapattern with capture buffers
and just test the capture buffers for which action to take...
FWIW, I just took the regular expression set for all the keywords of my
language and merged it with the reserved symbols into a larger pattern
separated by an alternation. Since the action code was identical, I
thought it would be a reasonable test. Unfortunately in my case, I didn't
notice any particular speed difference. As you said, this could be because
the pattern is slightly more complicated now or perhaps statistically
speaking the symbols just aren't seen often enough to make a difference...
Thanks,
-Clint
------------------------------
Date: 29 Jun 2004 11:27:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: eof and nested while (<$fh>) {...}
Message-Id: <cbrjn8$l9r$1@mamenchi.zrz.TU-Berlin.DE>
Greg Bacon <gbacon@hiwaay.net> wrote in comp.lang.perl.misc:
> I was writing code to scan an assembly-language definition of
> operational data and produce a report and ended up writing code
> that gave me the "there has to be a better way" feeling.
>
> Single parameters are easy to spot, e.g.,
>
> label1 .word 1234ABCDh
> label2 .float 3.14159
>
> Most arrays are trivial too:
>
> label3 .word 1, 2, 3
>
> Array specifications can span multiple lines, however. For example:
>
> label4 .float 0.0, 0.5, 1.0
> .float 1.5, 2.0, 2.5
[snip]
Ah, ye olde continuation line problem. Subtype 2, where you know if a
line *is* a continuation but not if a line *has* a continuation.
Here is one way of doing that. A continuation line is one that starts
with 10 blanks.
my $coll = '';
while ( <DATA> ) {
chomp;
if ( substr( $_, 0, 10) =~ /\S/ ) {
print "$coll\n" if length $coll;
$coll = $_;
} else {
$coll .= $_;
}
}
print "$coll\n" if length $coll;
This only collects continued lines into one. It would be simple
to add further processing to the loop so that it spits out ready-
to-use records.
Anno
------------------------------
Date: 29 Jun 2004 11:52:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: error logs...
Message-Id: <cbrl6a$l9r$3@mamenchi.zrz.TU-Berlin.DE>
John © <johnjcarbone@nospam.hotmail.com> wrote in comp.lang.perl.misc:
> "Peter Hickman" <peter@semantico.com> wrote
> And please stop touting yourself as the king of this 'culture'. I am sure a
> lot more people didn't even think twice about my little disclaimer than did.
Just for your information, I am among those who very much noticed
your "little disclaimer". I decided not to reply to someone who is
trying to single-sidedly set the terms of my reply.
Anno
------------------------------
Date: Tue, 29 Jun 2004 17:44:49 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <lUhEc.19507$Xn.2316@nwrdny03.gnilink.net>
"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:h7oqbc.vda.ln@goaway.wombat.san-francisco.ca.us...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2004-06-28, John © <johnjcarbone@nospam.hotmail.com> wrote:
>
> > Wow, so I guess you and three other people make up the whole 'culture',
> > because that's where the posts are coming from.
>
> No, just that those three people aren't completely sick of you by
> now.
Wow, that's rude. You have posted one reply and I am already sick of you.
Cheers,
John
------------------------------
Date: Tue, 29 Jun 2004 17:50:58 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <6_hEc.19537$Xn.566@nwrdny03.gnilink.net>
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote
> Just for your information, I am among those who very much noticed
> your "little disclaimer". I decided not to reply to someone who is
^^^^^^^^^^^^^^^^^^^^^
> trying to single-sidedly set the terms of my reply.
>
> Anno
And that's all I ASKED ... I didn't force anyone to do anything. I asked if
something could be done, if you weren't happy with that, then all you had to
do was not respond... if you feel that me asking you to not be rude would
set the terms of your reply and you didn't reply because of that, then
BINGO, success for me ... exactly what I wanted. So thanks. I didn't want
that type of reply anyway.
Cheers,
John
------------------------------
Date: Tue, 29 Jun 2004 17:57:17 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <14iEc.19567$Xn.18965@nwrdny03.gnilink.net>
"Peter Hickman" <peter@semantico.com> wrote
> ... rather than tell
> them they are doing it all wrong.
>
When exactly did I tell anyone they were doing anything wrong? I requested
something. Can you please read the posts and get the story straight. You
keep circumventing the real point which is I am not telling anyone they are
wrong, I am not trying to tell this group what is best. I made a request.
You're not like Hitler, but you're just like the Soup Nazi ... if you don't
do it YOUR way it's wrong, but I ask for people to be nice and I am wrong.
I asked, let me repeat, asked ... the term 'ask' means something different
than command. Please, keep acting the way you feel best, but for MY POST, I
requested a certain type of response. So even if you want to call this your
culture or your community, MY POST was MY HOUSE in this community, and if I
ask you to take of your shoes in my house, I would expect you to comply...
and if you don't like it, don't reply, that's all. But you just don't seem
to get that.
(and now for more thought police I am sure.)
Cheers,
John
------------------------------
Date: Tue, 29 Jun 2004 10:58:27 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: error logs...
Message-Id: <3kasbc.gdd.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-06-29, John © <johnjcarbone@nospam.hotmail.com> wrote:
> Wow, that's rude. You have posted one reply and I am already sick of you.
Hey, my plan worked!
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFA4a3BhVcNCxZ5ID8RAkm+AJ0SeTF8OBm8yxUfFIU2RGmR89PDdACeM3KJ
PbHVrC84+f6uxEHF5UQrnBU=
=M7V+
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 29 Jun 2004 13:20:03 +0100
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Re: How to use 2 DIFFERENT VERSIONS of the SAME MODULE in the same perl program ?
Message-Id: <cbrmtr$9fc$1@newshost.mot.com>
> But i wish i could find a way of dealing with 2 versions of the same
> module in the same perl program :-P
If you wrote the module, why not make the new module capable of handling
both types of database?
--
R.
GPLRank +79.699
------------------------------
Date: 29 Jun 2004 07:05:03 -0700
From: triumpht5@yahoo.com (D. Buck)
Subject: Re: Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server.
Message-Id: <f433d5cf.0406290605.77b6bc2f@posting.google.com>
You ROCK! Yes it was that simple. I wonder why the
$ftp->type("binary") didn't work?
Thank you.
Sisyphus <kalinaubears@iinet.net.au> wrote in message news:<40dc244c$0$24771$5a62ac22@per-qv1-newsreader-01.iinet.net.au>...
>
>
> To specify binary mode I use:
> $ftp->binary();
>
> This works fine for me for transferring files from my Windows FTP server
> to my Linux box.
>
> Hope the solution is _that_ simple :-)
>
> Cheers,
> Rob
------------------------------
Date: 29 Jun 2004 15:28:24 GMT
From: ctcgag@hotmail.com
Subject: Re: Non-unique columns via ODBC driver
Message-Id: <20040629112824.637$TG@newsreader.com>
I & L Fogg <il.fogg@bigpond.nospam.net.au> wrote:
> The error message is:
>
> DBD::ODBC::db prepare failed: [Simba][Simba ODBC Driver]Non unique
> column reference: Unused. (SQL-HY000)(DBD: st_prepare/SQLPrepare err=-1)
> at ./dbcopy.pl line 346.
It looks like this error originates with the ODBC driver itself, and Perl
merely passes it along. If that is the case, it is unlikely that there
is much you can about from within Perl.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 29 Jun 2004 12:59:39 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: Non-unique columns via ODBC driver
Message-Id: <f6iEc.20$Ro6.48750@news.uswest.net>
I & L Fogg wrote:
> Sorry, forgot to say that @cols does NOT contain the "Unused" column
> that the error message refers to.
>
> I & L Fogg wrote:
>
>> The error message is:
>>
>> DBD::ODBC::db prepare failed: [Simba][Simba ODBC Driver]Non unique
>> column reference: Unused. (SQL-HY000)(DBD: st_prepare/SQLPrepare
>> err=-1) at ./dbcopy.pl line 346.
>>
>> The code fragment that generates the message is:
>>
>> my $select = q/SELECT / .
>> join(',', @cols) .
>> q/ FROM / .
>> $src_dbh->quote_identifier($table);
It might help to:
print $select, "\n";
>> my $sel_sth = $src_dbh->prepare( $select );
>> $sel_sth->execute();
------------------------------
Date: Tue, 29 Jun 2004 21:30:30 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Nonblocking Pipe Open
Message-Id: <1107135.EWZglpOOTA@GMT-hosting-and-pickle-farming>
I need to combine pipe open + make it non-blocking. The semantics I want
are:
# based on perlopentut
open(NET, "ping 11.22.33.44 |", O_NONBLOCK ) || die "can't fork ping";
while (<NET>) { print }
close(NET)
which of course gets a syntax error.
Any idea how to achieve this?
gtoomey
------------------------------
Date: Tue, 29 Jun 2004 08:33:53 -0400
From: zentara <zentara@highstream.net>
Subject: Re: Nonblocking Pipe Open
Message-Id: <7bo2e098dilllvaro9fjmvqr0fbjp8pa1g@4ax.com>
On Tue, 29 Jun 2004 21:30:30 +1000, Gregory Toomey <nospam@bigpond.com>
wrote:
>I need to combine pipe open + make it non-blocking. The semantics I want
>are:
>
># based on perlopentut
> open(NET, "ping 11.22.33.44 |", O_NONBLOCK ) || die "can't fork ping";
> while (<NET>) { print }
> close(NET)
>
>which of course gets a syntax error.
>Any idea how to achieve this?
>
>gtoomey
Here is something I found:
#!/usr/bin/perl -Tw
# by John Sallwaechter
# In a perl script, I need to run a task on a regular interval,
# and also respond to other asynchronous events without waiting.
# My thought was to make a named pipe, and then use select()
# on it with a timeout. If the asynchronous event occurred,
# another process could drop a signal message into the named
# pipe, and my perl script would return from select() immediately.
# If no asynchronous event occurred, then the select() timeout
# would occur and the script could perform the periodic task
# before going back in to the select().
# I found lots of bits of information in the perldocs and by
# googling, but no good explicit examples. There is one major
# bit that's hard to locate: you need to open the named pipe
# as read/write. I finally got it all straightened out, so in
# the hope of saving someone else the search grief, here is a
# full example of using select() on a fifo:
#
# Example script that uses select() with
# a timeout on a named pipe.
#
use strict;
my $interval = 10; # seconds
my $fifo = "/tmp/testfifo"; # create from shell with "mkfifo
/tmp/testfifo"
if ( !( -p $fifo && -w _ && -r _ ) ) {
print STDERR "Bad fifo $fifo!\n";
exit(1);
}
# Open the fifo read/write, not just read. This is necessary because
# of the POSIX rules about using select() on named pipes when no writers
# are present. This is a very key step that is hard to find
documentation
# about.
open( FIFOFH, "+<", $fifo ) || die $!;
while (1) {
my $rin = '';
vec( $rin, fileno(FIFOFH), 1 ) = 1;
my $nfound = select( $rin, undef, undef, $interval );
print "It is now ", scalar(localtime), "\n";
if ($nfound) {
my $fifodata = <FIFOFH>;
print $fifodata, "\n";
}
# Do some other periodic tasks here...
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: 29 Jun 2004 07:53:33 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: PPT UNIX Reconstruction Project at: http://www.perl.com/language/ppt/
Message-Id: <239ce42f.0406290653.512b3c5b@posting.google.com>
"Clyde Ingram" <clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk> wrote in message news:<M61Dc.199$B2.41@newsfe6-gui.server.ntli.net>...
> Tad,
>
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrncdmo9e.3as.tadmc@magna.augustmail.com...
> > Clyde Ingram
> <clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk>
> wrote:
> > > Does anyone know where this web site has moved to?
> >
> >
> > http://sourceforge.net/projects/ppt/
>
> Thanks for this.
> But the PPT foundry is empty.
> There are no files and no documentation.
> Where should I look for the familiar links to a couple of dozen Perl
> implementations of UNIX commands?
>
Since you are on Outlook, if you have an ActiveState Perl distro, try
ppm install ppt
But I recommend for win32 a google search for UnixUtils.zip for the
GNU Win32 unix utlities.
------------------------------
Date: 29 Jun 2004 07:23:09 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Setting environment variables from a Perl script
Message-Id: <b893f5d4.0406290623.7ebf57df@posting.google.com>
> jl_post@hotmail.com (J. Romano) wrote in
> news:b893f5d4.0406281854.25a2c11d@posting.google.com:
>
> > Dear Perl community,
> >
> > In the past I have tried to find an answer to the question of how
> > to set environment variables in Perl scripts and make them last even
> > after the Perl script has finished. I eventually found the response
> > mentioned in "perldoc -q environment", which basically says that it
> > can't be done (although there are work-arounds if you're willing to
> > use a few Unix tricks).
>
> ...
>
> > But at the end of the script, add this line:
> >
> > exec $ENV{SHELL};
> >
> > Run your script, and voila'! The environment variable changes stick!
"A. Sinan Unur" <1usa@llenroc.ude> replied in message
news:<Xns9516EC0B3A600asu1cornelledu@132.236.56.8>...
>
> This complete and utter nonsense: You have not changed the environment
> variables in the shell from which you started your program. Instead, you
> started a new shell with a new environment. That may be what you want but
> then it very well may not be. The answer to the FAQ stands.
Be careful what you call "complete and utter nonsense": The
perldoc explicitly says that "there is shell magic that may allow you
to fake it by eval()ing the script's output in your shell." That
solution probably suffers the same faults my solution has.
Nevertheless, it made it into the perldocs. (And if it doesn't happen
to have the same faults that render my own findings "complete and
utter nonsense", I'd be happy to see that solution.)
Of course, the changes made by my solution aren't permanent (in
that, once you exit your shell and restart it, the changes made by the
Perl script are no longer there), but there are times when a user
needs to set up the ideal environment in which to begin work on a
specific task (I've done it several times myself), but doesn't want
those environment changes to be permanent.
That scenario is what leads many Perl users to ask the question, "I
know how to change environment variables in Perl, but how do I made
them outlast my Perl program?" Mine is one such solution that doesn't
require "...shell magic that may allow you to fake it by eval()ing the
script's output in your shell." Not that there's anything wrong with
that; I just offer a different solution.
-- Jean-Luc
------------------------------
Date: Tue, 29 Jun 2004 08:10:52 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Setting environment variables from a Perl script
Message-Id: <sp0sbc.bgc.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-06-29, J. Romano <jl_post@hotmail.com> wrote:
> Of course, the changes made by my solution aren't permanent (in
> that, once you exit your shell and restart it, the changes made by the
> Perl script are no longer there), but there are times when a user
> needs to set up the ideal environment in which to begin work on a
> specific task (I've done it several times myself), but doesn't want
> those environment changes to be permanent.
Don't you think it's a bit overkill to use a Perl script to set
shell environment variables? Why not (for example) write a bash
script that accomplishes the same task?
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFA4YZ5hVcNCxZ5ID8RAtubAKCVvzdTr2DBNYgkXI8ppGE5Cx+C3QCfXanq
j/xx/NsHf+etsB8ltzdF9pI=
=nqs1
-----END PGP SIGNATURE-----
------------------------------
Date: 29 Jun 2004 07:03:03 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Strange Behaviour with Hash???
Message-Id: <b893f5d4.0406290603.749b5b92@posting.google.com>
> Fergus Toolan wrote:
> > Is it correct to assign one hash to another? For instance
> >
> > %H1 = %H2;
> >
> > I want the hashs to be distinct. Will the above statement completely
> > overwrite the current contents of %H1?
vali <vticau@excite.com> replied:
> You may want:
>
> use Storable qw(dclone);
> my %H1 = %{ dclone(\%H2)};
Dear Fergus,
The line "%H1 = %H2;" will only create %H1 as its own distinct hash
as long at %H2 contains no references. But since you already stated
in a previous post that %H2 is a hash of array references, that won't
do what you want.
In your case, you can use the advice in vali's reply of using the
Storable module. However, I've found that not all Perl installations
have the Storable module (and I don't have permissions to install
modules from CPAN, either). If this is the case for you, the
Data::Dumper module (which should be a standard module) works great in
the absence of the Storable module:
use Data::Dumper;
%H1 = %{ eval Dumper(\%H2) }; # copies a hash with references
@A1 = @{ eval Dumper(\@A2) }; # copies an array with references
$a = eval Dumper($b); # copies an object (reference)
I like to use the Data::Dumper module to copy complex hashes and
arrays because I find that more portable, considering that all Perl
installations I've encountered have Data::Dumper. But if you already
have the Storable module (or don't mind installing it from CPAN), you
might as well use vali's approach over mine.
-- Jean-Luc
------------------------------
Date: 29 Jun 2004 10:05:14 -0700
From: dana_livni@hotmail.com (dana livni)
Subject: tern an hebrew string into unicode
Message-Id: <1596f85c.0406290905.537e7127@posting.google.com>
hello,
i hope you can help me.
i have an hebrow string (it can be in more languges) and i need to
tern it to somting i can send in a "get" but it have to be in unicode
for exmple:
the string דנה
need to be tern into %D7%93%D7%A0%D7%94
i tried alot of metouds but it does not work, please help me.
------------------------------
Date: Tue, 29 Jun 2004 17:24:36 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: tern an hebrew string into unicode
Message-Id: <oBhEc.14109$DT5.11010@nwrddc03.gnilink.net>
dana livni wrote:
> i hope you can help me.
> i have an hebrow string (it can be in more languges) and i need to
> tern it to somting i can send in a "get" but it have to be in unicode
> for exmple:
> the string דנה
This appears to be _one_ textual representation of those characters in
Unicode, presumably their numerical value in UTF-16?
> need to be tern into %D7%93%D7%A0%D7%94
This on the other hand doesn't look like Unicode at all but rather like
maybe URL encoding?
"Unicode" can be encoded in many different ways. Not only UTF-8 versus
UTF-16 versus UTF-32 but the resulting values can then be encoded in code
points (maybe what you got first), or as Base-64, or as URL-encode, or or
or.
Without knowing from where to where you really want to go it is very
difficult to offer any advise.
jue
------------------------------
Date: Tue, 29 Jun 2004 11:12:46 GMT
From: Andrew Lee <spamtrap@nowhere.com>
Subject: Re: Totally stuck
Message-Id: <6ui2e0134u69nvs2l9oj58v5eeqbiomjnl@4ax.com>
On 29 Jun 2004 00:32:36 -0700, darnold@northcoast.com (David Arnold) wrote:
>All,
>
>I have a file named "new".
>
>\backtomargin
>
>
>In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
>differential equation is autonomous, identify the equilibrium
>solution(s). Use a numerical solver to sketch the direction field
>and superimpose the plot of the equilibrium solution(s) on the
>direction field. Classify each equilibrium point as either
>unstable or asymptotically stable.
>
>
>
>
>
>
>\ex\label{exer2.9.1} $P'=0.05P-1000$
>
>The spacing is intentional. Now, my perl file is saved as new.pl.
>
>use strict;
>use warnings;
>
># replace \backtomargin with instructions environment
>my @instructions;
>my $instruct_line;
>while (my $line=<>) {
> chomp($line);
> if ($line=~/^\s*\\backtomargin/) {
But there is no space before "\backtomargin" ... so the following lines never
get executed.
> push (@instructions,$');
> while ($instruct_line=<>) {
> chomp($instruct_line);
> if ($instruct_line=~/\\ex/) {
> last;
> } else {
> push(@instructions,$instruct_line);
> }
> }
.snip
From what I can gather at a quick look, you are trying to nab everything between
"\backtomarin" and "\endofinstructions". Am I correct?
If so, try this :
if ($line=~/^\s+\\backtomargin/) {
and put whitespace before the delimeter "\backtomargin".
Better still, use a character or string that you don't expect to find elswhere
in the testfile, such as #.
Than you can say :
if ($line=~/^\#\\backtomargin/) {
... etc.
HTH
------------------------------
Date: Tue, 29 Jun 2004 13:32:03 -0400
From: thundergnat <thundergnat@hotmail.com>
Subject: Re: Totally stuck
Message-Id: <40e1a78c$0$23313$61fed72c@news.rcn.com>
Andrew Lee wrote:
> On 29 Jun 2004 00:32:36 -0700, darnold@northcoast.com (David Arnold) wrote:
>
>
>>All,
>>
>>I have a file named "new".
>>
>>\backtomargin
>>
>>
>>In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
>>differential equation is autonomous, identify the equilibrium
>>solution(s). Use a numerical solver to sketch the direction field
>>and superimpose the plot of the equilibrium solution(s) on the
>>direction field. Classify each equilibrium point as either
>>unstable or asymptotically stable.
>>
>>
>>
>>
>>
>>
>>\ex\label{exer2.9.1} $P'=0.05P-1000$
>>
>>The spacing is intentional. Now, my perl file is saved as new.pl.
>>
>>use strict;
>>use warnings;
>>
>># replace \backtomargin with instructions environment
>>my @instructions;
>>my $instruct_line;
>>while (my $line=<>) {
>> chomp($line);
>> if ($line=~/^\s*\\backtomargin/) {
>
>
> But there is no space before "\backtomargin" ... so the following lines never
> get executed.
>
I don't know... It looks to me like there is zero or more spaces before
'\backtomargin'.
Actually, I think the logic problem is the lines:
> while($line=pop(@instructions)) {
and
> while($line=shift(@instructions)) {
Since the first line that gets popped off of the array is a blank line,
the while() short circuits and the code block never gets executed.
Seems to me you are doing an awful lot of extra work chomping off
newlines only to add them back in, and making arrays when you really
want strings. If I was trying to do something similar, I would probably
do something like:
use strict;
use warnings;
my $instructions;
my $instruct_line;
while (<>) {
if ($_ =~ s/^\s*\\backtomargin//) {
$instructions = $_;
while ($instruct_line=<>) {
last if ($instruct_line =~ /\\ex/);
$instructions .= $instruct_line;
}
$instructions =~ s/ *\n/\n/g;
while ($instructions =~ s/\n\n\n/\n\n/) {};
$instructions =~ s/^\n+//;
$instructions =~ s/\n{2,}$/\n/;
print
"\\begin{instructions}\n$instructions\\end{instructions}\n\n$instruct_line\n";
} else {
print "$_\n";
}
}
Not knowing what your exact formatting needs were, I took a guess based
on what it /looked/ what you were trying to do.
------------------------------
Date: 29 Jun 2004 10:35:45 -0700
From: darnold@northcoast.com (David Arnold)
Subject: Re: Totally stuck
Message-Id: <7ff49536.0406290935.32aef90@posting.google.com>
gnari,
> clearly the while() block is never executed, because
> $line evaluates as false the first time through ('')
>
> maybe you want something like
> pop @instructions while $instructions[-1] =~ /^\s*$/;
Thank you very much. Your suggestion pointed to the difficulty. I am
now using the following and all is working well.
use strict;
use warnings;
# replace \backtomargin with instructions environment
my @instructions;
my $instruct_line;
while (my $line=<>) {
chomp($line);
if ($line=~/^\s*\\backtomargin/) {
push (@instructions,$');
while ($instruct_line=<>) {
chomp($instruct_line);
if ($instruct_line=~/\\ex/) {
last;
} else {
push(@instructions,$instruct_line);
}
}
print "\\begin{instructions}\n";
# remove blank lines from end of array
pop @instructions while $instructions[-1]=~/^\s*$/;
# remove blank lines from the beginning of the array
shift @instructions while $instructions[0]=~/^\s*$/;
print join("\n",@instructions);
# empty instructions array for next pass
@instructions=();
print "\n\\end{instructions}\n\n";
print "$instruct_line\n";
} else {
print "$line\n";
}
}
------------------------------
Date: Tue, 29 Jun 2004 12:22:49 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: undefined subroutine that is defined? mob_perl / perl 5.8.4 issue?
Message-Id: <cbrjea$voq$1@news.freedom2surf.net>
In article <GZqdnStQiNh0B33d4p2dnA@comcast.com>, "Dan Burke"
<dburke210@comcast.net> wrote:
> "Richard Gration" <richard@zync.co.uk> wrote in message
<SNIP>
>> All very well, but the error is telling you that the subroutine
>> CS_Get_Account_Data isn't defined in package gccDispCustomAcctData at
>> runtime, which means that it isn't being imported properly regardless
>> of whether it is exported properly.
>
> Well, yes of course that's the problem. The issue is, and why?>
Very sorry, didn't mean to be patronising. Any luck yet?
R
------------------------------
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 6745
***************************************