[23549] in Perl-Users-Digest
Perl-Users Digest, Issue: 5757 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 6 00:05:55 2003
Date: Wed, 5 Nov 2003 21:05:09 -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 Wed, 5 Nov 2003 Volume: 10 Number: 5757
Today's topics:
"pack" perldoc error? (J. Romano)
Converting a list join to a scaler/string <sdfg@sdg.com>
Re: Converting a list join to a scaler/string (Sam Holden)
Re: Converting a list join to a scaler/string <footnipple@indiatimes.com>
Re: Converting a list join to a scaler/string (Tad McClellan)
Re: Converting a list join to a scaler/string <usenet@morrow.me.uk>
equivalent perl for sed command ..newbie question (walter)
Re: equivalent perl for sed command ..newbie question <usenet@morrow.me.uk>
help with Mail::IMAPClient-2.2.9 <dpham@mercy_dot_com.au>
Re: help with Mail::IMAPClient-2.2.9 <kalinaubears@iinet.net.au>
Re: I think what I need is a backreference but it doesn (Tad McClellan)
Re: Insert file date created into a variable <REMOVEsdnCAPS@comcast.net>
Re: Insert file date created into a variable <usenet@morrow.me.uk>
math operations <fJogham@yahoo.com>
Re: math operations <kalinaubears@iinet.net.au>
Pls point me in the right direction - hide e-mail addre <pissoffspammers@aol.com>
Re: Pls point me in the right direction - hide e-mail a (David Efflandt)
Re: Pls point me in the right direction - hide e-mail a <usenet@morrow.me.uk>
Re: Problem Connecting w Perl/DBD::Oracle as SYSDBA (Joel Garry)
Re: Problem with a string <noreply@gunnar.cc>
Re: Problem with a string <noreply@gunnar.cc>
Re: Problem with a string <noreply@gunnar.cc>
Re: Problem with a string Default@User.net
Re: Problem with a string <noreply@gunnar.cc>
Re: problem with if-else assignment in text database (Tad McClellan)
Re Problem with a string Default@User.net
Re: Re: Problem with a string Default@User.net
Re: text and html email (James Willmore)
Re: Tool to embed images (or other binaries) in your P <usenet@giantsquidmarks.com>
Re: what is @$? <abigail@abigail.nl>
Re: what language is this? <abigail@abigail.nl>
Re: what language is this? (Tad McClellan)
Re: what language is this? (Kevin Shay)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Nov 2003 19:36:06 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: "pack" perldoc error?
Message-Id: <b893f5d4.0311051936.7fb18a10@posting.google.com>
Dear All,
I recently got burned with some code that I wrote, so I thought I
might share it with you all (at least to raise awareness):
I was packing a string with a line like:
$packedString = pack("a10",$text);
and unpacking with a line like:
$text2 = unpack("A10",$packedString);
I packed the text with "a" because I wanted to pad the remaining
spaces with null characters, and I unpacked the same string with "A"
because, according to the documentation, "A" strips trailing spaces
and nulls.
So as long as the $text variable doesn't have any trailing spaces
(and assuming it's not longer than 10 characters), $text2 should
always be the same as $text, right?
Well, no, it's not. Apparently, if $text ends with any number of
newlines (like "Hello!\n\n\n\n"), the newlines will get stripped off
when it is unpacked with "A", even though the documentation only says
that trailing spaces and null will be stripped off (while making no
mention of other types of whitespace). I tried this on Linux and
Win32, and they both behave the same way. It took me a while to
figure this out when I was hunting down a bug in one of my scripts.
Another thing I found that was not correct was in the perldoc for
"pack". It explicitly says: 'When packing, "a", and "Z" are
equivalent.' However, I found (at least on Linux and
Win32-ActiveState) that "Z" will always null-terminate a string, even
if it means an extra character of the string gets cut off.
Here's a short perl script to demontrate:
#!/usr/bin/perl -w
use strict;
my $text = "1234567890";
my $a_packed = pack('a5', $text);
my $Z_packed = pack('Z5', $text);
my $a_len = length($a_packed);
my $Z_len = length($Z_packed);
print "\$a_packed: \"$a_packed\" (length = $a_len)\n";
print "\$Z_packed: \"$Z_packed\" (length = $Z_len)\n";
__END__
This script prints:
$a_packed: "12345" (length = 5)
$Z_packed: "1234" (length = 5)
According to the perldoc, "a" and "Z" are equivalent when used with
"pack", yet apparently they are not here, or else $a_packed and
$z_packed would be identical strings. Apparently "Z" always
null-terminates the string, even if the string is longer than the
length of the field to pack it in.
So this is either a bug with the pack function or else the perldoc
documentation is a little wrong. I would like to use packing with "Z"
in one of my scripts, but I'm a little hesitant to do so until I know
how it's supposed to work (and that it's working correctly).
Does anybody know what the correct behavior of pack("Z5",$text)
should be?
(And is unpacking with "A" supposed to strip off any trailing
newlines or whitespace?)
Thanks.
-- J.
------------------------------
Date: Thu, 06 Nov 2003 03:40:27 GMT
From: "sdfgsd" <sdfg@sdg.com>
Subject: Converting a list join to a scaler/string
Message-Id: <Lojqb.168593$ox6.2376002@twister.tampabay.rr.com>
Hello,
Did the sites, books and google and still can't figure this out:
my @quoted = map {"'$_', "} @fields;
my $insert = join ' ', @quoted;
I just need to "flatten" or make $insert an actual string
Thanks again for your help.
------------------------------
Date: 6 Nov 2003 04:04:43 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Converting a list join to a scaler/string
Message-Id: <slrnbqji2r.68d.sholden@flexal.cs.usyd.edu.au>
On Thu, 06 Nov 2003 03:40:27 GMT, sdfgsd <sdfg@sdg.com> wrote:
Is that your real email address?
Do you have permission from the Strategic Decisions Group to
use that address.
Claiming such an address without permission from the owner is
illegal in some jurisdictions.
If you want an invalid address then use whatever.invalid or
example.(com|org|net).
> Hello,
>
> Did the sites, books and google and still can't figure this out:
>
> my @quoted = map {"'$_', "} @fields;
> my $insert = join ' ', @quoted;
>
> I just need to "flatten" or make $insert an actual string
$insert is a string. Something like "'abc', 'def', 'ghi',".
It helps to mention what the problem is.
And to say what you expected and what your result actually was.
--
Sam Holden
------------------------------
Date: Thu, 06 Nov 2003 04:23:29 GMT
From: "sdfgsd" <footnipple@indiatimes.com>
Subject: Re: Converting a list join to a scaler/string
Message-Id: <51kqb.168830$ox6.2380835@twister.tampabay.rr.com>
"Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
news:slrnbqji2r.68d.sholden@flexal.cs.usyd.edu.au...
> On Thu, 06 Nov 2003 03:40:27 GMT, sdfgsd <sdfg@sdg.com> wrote:
>
> Is that your real email address?
>
> Do you have permission from the Strategic Decisions Group to
> use that address.
>
> Claiming such an address without permission from the owner is
> illegal in some jurisdictions.
Ignorance is still a valid excuse right? Thanks for pointing it out, it's
changed. This news account was set up in haste.
> > my @quoted = map {"'$_', "} @fields;
> > my $insert = join ' ', @quoted;
> >
> > I just need to "flatten" or make $insert an actual string
>
> $insert is a string. Something like "'abc', 'def', 'ghi',".
>
> It helps to mention what the problem is.
The end goal is to build an SQL INSERT:
my @fields = qw(Name Address City State Zip Phone);
my @quoted = map {"'$_', "} @fields;
my $insert = join ' ', @quoted;
The problem is that I need $insert to be an actual string so that I can
concatenate it with a set of parenthesis and the rest of the INSERT. I then
need to push these INSERTS into a file for later use.
The expected output if I were to print $insert: ('name', 'address', ...)
Thanks for the response.
------------------------------
Date: Wed, 5 Nov 2003 22:22:13 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Converting a list join to a scaler/string
Message-Id: <slrnbqjj3l.1o4.tadmc@magna.augustmail.com>
sdfgsd <sdfg@sdg.com> wrote:
> my $insert = join ' ', @quoted;
>
> I just need to "flatten" or make $insert an actual string
It already _is_ an actual string.
Problem solved!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 6 Nov 2003 04:43:14 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Converting a list join to a scaler/string
Message-Id: <bocjh2$bt8$4@wisteria.csv.warwick.ac.uk>
"sdfgsd" <footnipple@indiatimes.com> wrote:
> The end goal is to build an SQL INSERT:
>
> my @fields = qw(Name Address City State Zip Phone);
> my @quoted = map {"'$_', "} @fields;
> my $insert = join ' ', @quoted;
>
> The problem is that I need $insert to be an actual string so that I can
> concatenate it with a set of parenthesis and the rest of the INSERT. I then
> need to push these INSERTS into a file for later use.
>
> The expected output if I were to print $insert: ('name', 'address', ...)
$insert = join ', ', map { "'$_'" } @fields;
$insert = "($insert)";
Ben
--
$.=1;*g=sub{print@_};sub r($$\$){my($w,$x,$y)=@_;for(keys%$x){/main/&&next;*p=$
$x{$_};/(\w)::$/&&(r($w.$1,$x.$_,$y),next);$y eq\$p&&&g("$w$_")}};sub t{for(@_)
{$f&&($_||&g(" "));$f=1;r"","::",$_;$_&&&g(chr(0012))}};t # ben@morrow.me.uk
$J::u::s::t, $a::n::o::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $.
------------------------------
Date: 5 Nov 2003 20:19:43 -0800
From: arena318@yahoo.com (walter)
Subject: equivalent perl for sed command ..newbie question
Message-Id: <ea168806.0311052019.1acafde9@posting.google.com>
Hi,
I just started learning perl.
Now I know
perl -p -e 's/exp1/exp2/g' file
is equivalent to
sed -e 's/exp1/exp2/g' file
But I can't realize what's the perl equivalent to
sed -e '/exp1/,/exp2/d' file
I tried to mimic it using
perl -p -e '/exp1/,/exp2/d'
but, of course, it didn't work...
Yes...I know it's a dumb question....Sorry!
Thanks for your time and patience !
------------------------------
Date: Thu, 6 Nov 2003 04:51:45 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: equivalent perl for sed command ..newbie question
Message-Id: <bock11$bt8$5@wisteria.csv.warwick.ac.uk>
arena318@yahoo.com (walter) wrote:
> Now I know
>
> perl -p -e 's/exp1/exp2/g' file
>
> is equivalent to
>
> sed -e 's/exp1/exp2/g' file
Except that Perl's regexes are better :)
> But I can't realize what's the perl equivalent to
>
> sed -e '/exp1/,/exp2/d' file
perl -ne'print unless /exp1/.../exp2/'
See perldoc perlop for .. and ..., and the differences between them.
Ben
--
If you put all the prophets, | You'd have so much more reason
Mystics and saints | Than ever was born
In one room together, | Out of all of the conflicts of time.
ben@morrow.me.uk |----------------+---------------| The Levellers, 'Believers'
------------------------------
Date: 6 Nov 2003 00:10:27 GMT
From: Zoong Pham <dpham@mercy_dot_com.au>
Subject: help with Mail::IMAPClient-2.2.9
Message-Id: <slrnbqj5i8.6o4.dpham@websvr01.mercy.com.au>
I write a little Perl script using Mail::IMAPClient-2.2.9
to monitor a MS Exchange IMAP mailbox.
It works OK with my own mailbox.
However, I don't know how to access a shared mailbox that doesn't have a
primary owner.
The shared mailbox can be accessed (by MS Outlook) by multiple
accounts including mine.
I know only my account's username and password.
I read the man page of Mail::IMAPClient, Google and comp.lang.perl.misc
but still can't find the solution.
Any help would be very appreciated.
TIA,
--
Zoong PHAM UNIX Systems Administrator
Mercy Health and Aged Care Inc. Melbourne - Australia
zpham@mercy_dot_com_dot_au +61 - 3 - 84167747
PGP public key is available on request
------------------------------
Date: Thu, 06 Nov 2003 15:35:24 +1100
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: help with Mail::IMAPClient-2.2.9
Message-Id: <3fa9d04b$0$1740$5a62ac22@freenews.iinet.net.au>
Zoong Pham wrote:
> I write a little Perl script using Mail::IMAPClient-2.2.9
> to monitor a MS Exchange IMAP mailbox.
> It works OK with my own mailbox.
>
> However, I don't know how to access a shared mailbox that doesn't have a
> primary owner.
> The shared mailbox can be accessed (by MS Outlook) by multiple
> accounts including mine.
>
I would have assumed that providing your own username and password (or
the username and password of *anybody* who is permitted to access that
mail account) would work.
Not correct ?
Make sure you 'use warnings;'.
Also check the docs for how to enable debugging, and do that - it might
produce some useful information for you.
I think you'll turn on debugging by specifying something like 'Debug =>
1,' in the 'new()' constructor ... but check the docs.
If it still proves difficult to solve, it would be best to post some
simple code that demonstrates the problem, along with the error messages
produced.
Hth.
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Wed, 5 Nov 2003 17:55:17 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: I think what I need is a backreference but it doesn't ever match
Message-Id: <slrnbqj3f5.234.tadmc@magna.augustmail.com>
Sara <genericax@hotmail.com> wrote:
> I tried something like:
>
> s/^(\w+\d)(.+)\n\1 is ([^\n]+)\n/$1 is $3$2/gsm;
>
> which runs with no errors, yet never matches anything.
^^^^^^^^^^^^^
Yes it does.
Why didn't you post a short and complete program that we can run
that illustrates your problem?
Something like:
-----------------------
#!/usr/bin/perl
use strict;
use warnings;
$_ = 'CAT1
DOG2
MOUSE
EEL
CAT1 is ALFIE
DOG2 is FRED
';
print "before: $_";
print "-----\n";
s/^(\w+\d)(.+)\n\1 is ([^\n]+)\n/$1 is $3$2/gsm;
print "after : $_";
-----------------------
Since it outputs a changed $_, the s/// *did* match.
So we aren't seeing what you are seeing, which makes it much
harder to fix what you are seeing...
1 while s/^(\w+\d)(.+\n)\1 is ([^\n]+)\n/$1 is $3$2/sm;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 05 Nov 2003 17:31:33 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Insert file date created into a variable
Message-Id: <Xns942ABC73FBF95sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
petersen_cp@hotmail.com (Chris Petersen) wrote in
news:d1bad213.0311051348.608a4bda@posting.google.com:
> Is there a better/simpler way than this?
>
> use POSIX ('strftime');
> my $dateCreated = strftime "%b %d, %Y %H:%M", localtime
> ((stat("c:\\test.txt"))[10]);
>
> How would I go about displaying the output in this format: 20031105
> 14:00? Any advice of links would be appreciated. Thanks in advance
> -Chris
This is why I wrote Time::Format. I got sick of looking up the awkward
strftime %-codes, and was tired of having to make do when they weren't
flexible enough.
use Time::Format;
my $dateCreated = time_format('yyyymmdd hh:mm',(stat $file)[10]);
http://search.cpan.org/~roode/Time-Format-0.13/Format.pm
Hope it helps.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP6mISWPeouIeTNHoEQLZQwCgnh5zmXI0rLBQYUzcMWpEU/T4dO0An28m
Qv8YB1yVKzx0ofBrlLrcFPfw
=0SEz
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 6 Nov 2003 04:36:04 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Insert file date created into a variable
Message-Id: <bocj3k$bt8$3@wisteria.csv.warwick.ac.uk>
Tore Aursand <tore@aursand.no> wrote:
> Remember, however, that you cannot expect ctime to be the creation time of
> the file;
I think you probably can on Win32?
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off the
shoulder of Orion; I've watched C-beams glitter in the darkness near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| ben@morrow.me.uk
------------------------------
Date: Thu, 06 Nov 2003 13:20:46 +1100
From: Fred <fJogham@yahoo.com>
Subject: math operations
Message-Id: <3FA9AFFE.4090004@yahoo.com>
Hello
I need to do some calculations using math operator like
element of
overlap
summation
and others in this link
http://whatis.techtarget.com/definition/0,,sid9_gci803019,00.html
does perl support those operations? is there an add on module or use
another language?
thanks
------------------------------
Date: Thu, 06 Nov 2003 15:19:47 +1100
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: math operations
Message-Id: <3fa9cca2$0$1730$5a62ac22@freenews.iinet.net.au>
Fred wrote:
> Hello
> I need to do some calculations using math operator like
> element of
> overlap
> summation
> and others in this link
> http://whatis.techtarget.com/definition/0,,sid9_gci803019,00.html
>
> does perl support those operations? is there an add on module or use
> another language?
>
> thanks
>
See 'perldoc perlop'.
See also 'perldoc -f *', where '*' means (in turn) 'abs', 'atan2',
'cos', 'exp', 'hex', 'int', 'log', 'oct', 'sin', 'sqrt'.
"element of overlap" sounds like it might be a job for "List::Compare",
though I'm not entirely sure that I know what an "element of overlap" is :-)
For other stuff go to http://search.cpan.org and do a search for modules
that match 'Math', and maybe a search for modules that match 'Algorithm'.
If you still can't find a specific functionality that you want then ask
here for info regarding its whereabouts. It probably exists.
C will generally be significantly faster for math operations - but perl
is easier to code. Some modules provide 'C' under the hood so you get
the best of both worlds.
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Wed, 5 Nov 2003 19:13:50 -0000
From: "Doesn't Matter" <pissoffspammers@aol.com>
Subject: Pls point me in the right direction - hide e-mail address
Message-Id: <Hzhqb.1353$es3.2098524@newsfep1-win.server.ntli.net>
Greetings
I am not looking for a spambot killer or an obfuscator, what I need
is something that will achieve the following. Could someone pls point
me at a suitable script.
I run a site which, in part, allows a runaway child or their parents to
communicate with each other by messages, I would like them to be
able to do this by e-mail however, neither side, and particularily the
child side should have their e-mail address divulged.
What I need is basically a simple form with a text box and a 'Send Message'
button that, in the background in fact sends an e-mail without anyone being
able to see where the e-mail is actually going to, neither in the status bar
or by viewing the source.
Is this possible in Perl or am I better to have all the e-mails directed to
us and
we re-send them on. Surely something like this though can be automated.
Similiar, I guess, to how it is done on the 'dating' websites.
Any pointers gratefully received.
Webmaster
http://www.kidwatch-uk.net
------------------------------
Date: Thu, 6 Nov 2003 02:15:11 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Pls point me in the right direction - hide e-mail address
Message-Id: <slrnbqjblf.akn.efflandt@typhoon.xnet.com>
On Wed, 5 Nov 2003, Doesn't Matter <pissoffspammers@aol.com> wrote:
> I am not looking for a spambot killer or an obfuscator, what I need
> is something that will achieve the following. Could someone pls point
> me at a suitable script.
> I run a site which, in part, allows a runaway child or their parents to
> communicate with each other by messages, I would like them to be
> able to do this by e-mail however, neither side, and particularily the
> child side should have their e-mail address divulged.
> What I need is basically a simple form with a text box and a 'Send Message'
> button that, in the background in fact sends an e-mail without anyone being
> able to see where the e-mail is actually going to, neither in the status bar
> or by viewing the source.
> Is this possible in Perl or am I better to have all the e-mails directed to
> us and we re-send them on.
You could store a colon separated unique ID and e-mail address list in
separate file like (doesn't even matter if the ID is a name with spaces,
just so you weed out any colons):
id_string:email@some.domain
or
1st_name Lastname:email@some.domain
Demo script to find them:
#!/usr/bin/perl -w
my $id = shift; # actually assign this from form variable
my $addrfile = 'addrlist.txt';
my $email;
open(IN, $addrfile) || die "can't open $addrfile: $!\n";
while (<IN>) {
chomp;
if (/^$id:(.+)$/) {
$email = $1;
last;
}
}
print "$id\t$email\n";
--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Thu, 6 Nov 2003 04:34:47 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Pls point me in the right direction - hide e-mail address
Message-Id: <bocj17$bt8$2@wisteria.csv.warwick.ac.uk>
"Doesn't Matter" <pissoffspammers@aol.com> wrote:
> Greetings
> I am not looking for a spambot killer or an obfuscator, what I need
> is something that will achieve the following. Could someone pls point
> me at a suitable script.
> I run a site which, in part, allows a runaway child or their parents to
> communicate with each other by messages, I would like them to be
> able to do this by e-mail however, neither side, and particularily the
> child side should have their e-mail address divulged.
You will need to be careful about all the places in the email where
the 'sender' address might appear, particularly the SMTP envelope.
I would suggest the 'From' line should contain just a name (no address
at all) and the sender address and Reply-To should be
<child's-id@yoursite.org>, which you can then forward to the child.
Ben
--
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
ben@morrow.me.uk <=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=> (Kate Rusby)
------------------------------
Date: 5 Nov 2003 16:09:24 -0800
From: joel-garry@home.com (Joel Garry)
Subject: Re: Problem Connecting w Perl/DBD::Oracle as SYSDBA
Message-Id: <91884734.0311051609.4d981341@posting.google.com>
Ron Reidy <r_reidy@comcast.net> wrote in message news:<3FA8F314.2000405@comcast.net>...
> Can you (the same OS user) connect as sysdba via SQL*Plus to instance BB?
>
> Is your Oracle environment correct (I see you set ORACLE_SID, but what
> about ORACLE_HOME, etc.)?
And more in that vein: orapwd generated properly for each db, and
with proper ownership/protection? You aren't trying to be a root dba?
init.ora variables the same (except where necessary)? Can you
connect as a regular user in sqlplus and then connect as sysdba?
You've checked for duplicate entries in tnsnames.ora? Try changing
the sys password?
jg
--
@home.com is bogus.
https://secure.msfreepc.com/step1.php
------------------------------
Date: Thu, 06 Nov 2003 00:22:14 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with a string
Message-Id: <boc0t0$1cjbgk$1@ID-184292.news.uni-berlin.de>
Default@User.net wrote:
> When I enter two out of range values I get unexpected results.
> eg: -20 and 20
> gives this for output: Negative plus equals zero
Unexpected? Why? What had you expected it to print?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 06 Nov 2003 01:14:38 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with a string
Message-Id: <boc3vm$1ban3f$1@ID-184292.news.uni-berlin.de>
Default@User.net wrote:
> Sorry this should explain things better i hope.
> I want to know why it says "Negative plus equals zero".
Okay, now I understand.
You may want to change the line
if ($hash_one{$key3})
to
if ($hash_one{$key1} and $hash_one{$key2})
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 06 Nov 2003 01:19:44 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with a string
Message-Id: <boc494$1d4uef$1@ID-184292.news.uni-berlin.de>
Gunnar Hjalmarsson wrote:
> You may want to change the line
>
> if ($hash_one{$key3})
>
> to
>
> if ($hash_one{$key1} and $hash_one{$key2})
No, that's not good enough either. Try:
if ($hash_one{$key1} and $hash_one{$key2} and $hash_one{$key3})
instead.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 06 Nov 2003 00:46:17 GMT
From: Default@User.net
Subject: Re: Problem with a string
Message-Id: <tRgqb.1700$Ca.287@nwrdny02.gnilink.net>
Ahh yes I see now. I may need to add a seperate subroutine if this value does indeed exist.
if $hash_one{$key3}
Then if that is true it will run this in a new sub.
if ($hash_one{$key1} and $hash_one{$key2})
Thanks alot for the suggestions, just what i needed to hear :-)
------------------------------
Date: Thu, 06 Nov 2003 01:49:55 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with a string
Message-Id: <boc622$143tnv$1@ID-184292.news.uni-berlin.de>
Default@User.net wrote:
> Thanks alot for the suggestions,
You are welcome.
> just what i needed to hear :-)
Actually, there is one thing besides that...
Make it a habit from now on to
use strict;
use warnings;
That will save you trouble in the future.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 5 Nov 2003 18:00:57 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: problem with if-else assignment in text database
Message-Id: <slrnbqj3pp.234.tadmc@magna.augustmail.com>
Vumani Dlamini <dvumani@hotmail.com> wrote:
> if ($1 == /\S{2}/) {$Emale = $1 ;}
You should always enable warnings when developing Perl code.
> Hope you girls (and
> possibly guys) help me as always.
Hope you would have the courtesy to ask a machine to help
you *before* asking thousands of real people to spend
their time on it.
Enable warnings.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 06 Nov 2003 00:47:54 GMT
From: Default@User.net
Subject: Re Problem with a string
Message-Id: <_Sgqb.1705$Ca.1506@nwrdny02.gnilink.net>
Ahh yes I see now. I may need to add a seperate subroutine if this value does indeed exist.
if $hash_one{$key3}
Then if that is true it will run this in a new sub.
if ($hash_one{$key1} and $hash_one{$key2})
Thanks alot for the suggestions, just what i needed to hear :-)
------------------------------
Date: Wed, 05 Nov 2003 23:50:53 GMT
From: Default@User.net
Subject: Re: Re: Problem with a string
Message-Id: <x1gqb.432$28.270@nwrdny01.gnilink.net>
Sorry this should explain things better i hope.
I want to know why it says "Negative plus equals zero".
Thank you very much for replying.
Enter a number (0-9): 4 <---normal operation
Enter another number (0-9): 4
Four plus four equals eight
Enter a number (0-9): 20 <---out of range but normal
Enter another number (0-9): 20
20 plus 20 equals 40
Enter a number (0-9): -20 <---out of range but normal
Enter another number (0-9): -20
Negative 20 plus negative 20 equals negative 40
Enter a number (0-9): -20 <---here is the problem
Enter another number (0-9): 20
Negative plus equals zero
Enter a number (0-9): end <---normal operation
Enter another number (0-9):
Ending program
------------------------------
Date: 5 Nov 2003 16:36:13 -0800
From: jwillmore@myrealbox.com (James Willmore)
Subject: Re: text and html email
Message-Id: <d61170e5.0311051636.7ff4b6db@posting.google.com>
octavp_2000@yahoo.com (Popovici Nicolae) wrote in message news:<e32ba0d5.0311050550.385e9948@posting.google.com>...
> Hello guys,
>
> Here is my dilema. I am getting my emails using a perl script and
> with Mail::Pop3Client module. Now, when I am reading my emails with
> BodyToFile , I get the plain/text message and also the plain/html one.
> How can I get rid of the plain/html part ?
>
> Any ideeas ?
Now that you have put the body into a file, you could use one of the
MIME modules to split the message apart into it's respective parts.
If I find an example (because I did something along these lines some
time ago), I'll post it.
HTH
Jim
(jwillmore _at_ adelphia _dot_ net)
------------------------------
Date: Wed, 5 Nov 2003 17:06:20 -0700
From: "Michael Carey" <usenet@giantsquidmarks.com>
Subject: Re: Tool to embed images (or other binaries) in your Perl source.
Message-Id: <3fa98f84$1_7@127.0.0.1>
Although I cannot say exactly why, I performed a search-replace to satisfy
your objection.
Regards,
Michael
------------------------------
Date: 05 Nov 2003 23:32:58 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: what is @$?
Message-Id: <slrnbqj25a.45g.abigail@alexandra.abigail.nl>
Ben Morrow (usenet@morrow.me.uk) wrote on MMMDCCXVIII September MCMXCIII
in <URL:news:bobo8t$1fb$1@wisteria.csv.warwick.ac.uk>:
::
:: tassilo.parseval@post.rwth-aachen.de wrote:
:: > Also sprach Ben Morrow:
:: > > But use base use()s the module you ask for, and I read hear a while
:: > > ago that one ought not to use Exporter as the semantics of that were
:: > > not yet defined...?
:: >
:: > That I'd like to know in more detail. I always 'use base qw(Exporter)'
:: > when my module exports something. I never had any problems with it so
:: > far. I don't find any such warning in Exporter's documentation either.
::
:: I don't know: as I said, I read a warning about it here which I didn't
:: really understand. Exporter's documentation does say 'require
:: Exporter;' rather than 'use Exporter;'...
::
:: The source of any problems, I suppose, is that 'use Exporter' will
:: call Exporter->import. As @Exporter::EXPORT et al are not defined,
:: this shouldn't do anything; but I suppose someone could change that.
I've never understood why it says 'require Exporter'. Why delay
compiling Exporter to run-time? I don't see what's wrong with:
use Exporter ();
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: 05 Nov 2003 23:36:51 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: what language is this?
Message-Id: <slrnbqj2cj.45g.abigail@alexandra.abigail.nl>
Chris Mattern (syscjm@gwu.edu) wrote on MMMDCCXVIII September MCMXCIII in
<URL:news:3FA95E7C.804@gwu.edu>:
:} Fred wrote:
:} > hello
:} > I am trying to understand a lettle about a code in a language which is
:} > not perl. would someone know what language it is?
:} >
:} > e.g. in perl
:} > my $a = 0b100001;
:} > my $b = 0b010001;
:} > the logic operator for xOr is "^"
:} >
:} >
:} > in this language it is
:} > |xOr(a,b)|
:} >
:}
:} Fred, you've given virtually no data. What you've described could
:} cover literally hundreds (hell, thousands) of languages, *including*
:} Perl if the program in question defined an "xOr" subroutine. Try
:} giving a couple of dozen lines of code as an example; it might be
:} possible to determine the language from that.
Well, it might be possible to define an 'xOr' subrouting in Perl, it's
not possible to define your own operators. And considering Perl doesn't
have unary |, or any circumfix operators, I don't see how the quoted
line could be valid Perl. (Input to filters doesn't count).
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: Wed, 5 Nov 2003 18:03:33 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: what language is this?
Message-Id: <slrnbqj3ul.234.tadmc@magna.augustmail.com>
Fred <fJogham@yahoo.com> wrote:
> I am trying to understand a lettle about a code in a language which is
> not perl.
Please do not make off-topic posts.
Please do not throw litter the park.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Nov 2003 21:03:36 -0800
From: kevin_shay@yahoo.com (Kevin Shay)
Subject: Re: what language is this?
Message-Id: <5550ef1e.0311052103.72bc104@posting.google.com>
Fred <fJogham@yahoo.com> wrote in message
news:<3FA9547E.1070402@yahoo.com>...
> in this language it is
> |xOr(a,b)|
Are you sure that's not just a really elaborate smiley?
--Kevin
------------------------------
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.
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 5757
***************************************