[19813] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2008 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 25 11:10:34 2001

Date: Thu, 25 Oct 2001 08:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004022612-v10-i2008@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 25 Oct 2001     Volume: 10 Number: 2008

Today's topics:
        Perl for Oracle <riggers5No@SPAMhotmail.com>
        perl script for sending mail <gt4684b@acmez.gatech.edu>
    Re: perl script for sending mail <jasper@guideguide.com>
    Re: perl script for sending mail <bernard.el-hagin@lido-tech.net>
    Re: Plaintext to passwd file? <tsee@gmx.net>
    Re: Plaintext to passwd file? <darkon@one.net>
    Re: Plaintext to passwd file? <darkon@one.net>
    Re: Reading different string input <Graham.T.Wood@oracle.com>
    Re: What's wrong with File::Find <dtweed@acm.org>
    Re: What's wrong with File::Find <dtweed@acm.org>
        Win32 Perl book/software suggestions? (Frank McKenney)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 25 Oct 2001 23:21:12 +1000
From: riggers <riggers5No@SPAMhotmail.com>
Subject: Perl for Oracle
Message-Id: <3BD811C8.875B802B@SPAMhotmail.com>

Hi all, very newbie question here.

I'm using win32 perl on Win98SE machine and also have Oracle8i personal
edition installed.

How do I connect to the database to be able to query it.  I have
installed DBI and DBD-ORACLE8 packages and have tried following the
documentation but to no avail.  

Do I need to set up a listener in Oracle or an ODBC data source I'm
really not sure what to do.

If no direct answers can someone at least suggest some good introductory
sites to perl programming for databases  (preferably for Oracle8).

Thanks

riggers


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

Date: Thu, 25 Oct 2001 09:50:45 -0400
From: newsreader_at_gt <gt4684b@acmez.gatech.edu>
Subject: perl script for sending mail
Message-Id: <Pine.SOL.4.21.0110250944050.1985-100000@acmez.gatech.edu>

i found this script on www for sending email using sendmail #!

----------------------------------------------
/usr/bin/perl -w

#! /usr/bin/perl -w 

open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or
die "Can't fork for sendmail: $!\n";
        print SENDMAIL << "EOF" ;
        From: sender\@domain;
        To:    receiver\@domain;
        Subject: valid subject
        
        <body  of message> 

        EOF
        close(SENDMAIL) or warn "sendmail didn't close nicely"; exit ;
-----------------------------------------------


It gives the follg error.


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

Can't find string terminator "EOF" anywhere 
before EOF at send.pl line 4. 

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

any pointers ?

TIA,
kiran



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

Date: Thu, 25 Oct 2001 14:57:07 +0100
From: Jasper McCrea <jasper@guideguide.com>
Subject: Re: perl script for sending mail
Message-Id: <3BD81A33.E5E5394E@guideguide.com>

newsreader_at_gt wrote:
> 
> i found this script on www for sending email using sendmail #!
> 
> ----------------------------------------------
> /usr/bin/perl -w
> 
> #! /usr/bin/perl -w
> 
> open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or
> die "Can't fork for sendmail: $!\n";
>         print SENDMAIL << "EOF" ;
>         From: sender\@domain;
>         To:    receiver\@domain;
>         Subject: valid subject
> 
>         <body  of message>
> 
>         EOF
>         close(SENDMAIL) or warn "sendmail didn't close nicely"; exit ;
> -----------------------------------------------
> 
> It gives the follg error.
> 
> -------------------------------------------
> 
> Can't find string terminator "EOF" anywhere
> before EOF at send.pl line 4.
> 
> -------------------------------------------
> 
> any pointers ?
> 
> TIA,
> kiran

I believe there can't be anything at the start of the line before the
'EOF'. Even spaces.

Jasper
-- 
      split//,'019617511192'.
      '17011111610114101114'.
      '21011141011840799901'.
            '17101174';
            foreach(0..         # my
            $#_){$_[$_          # signature is too
            ++]^=$_[$_          # bignature
            --]^=$_[$_
]^=$_[++    $_]if!($_%
2)}$g.=$_  ,chr($g)=~
 /(\w)/&&($o.=$1and
   $g='')foreach@_;
      print"$o\n"


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

Date: 25 Oct 2001 13:57:44 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: perl script for sending mail
Message-Id: <slrn9tg66b.3nk.bernard.el-hagin@gdndev25.lido-tech>

On Thu, 25 Oct 2001 09:50:45 -0400, newsreader_at_gt <gt4684b@acmez.gatech.edu>
wrote:
> i found this script on www for sending email using sendmail #!
> 
> ----------------------------------------------
> /usr/bin/perl -w
> 
> #! /usr/bin/perl -w 
> 
> open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or
> die "Can't fork for sendmail: $!\n";
>         print SENDMAIL << "EOF" ;
>         From: sender\@domain;
>         To:    receiver\@domain;
>         Subject: valid subject
>         
>         <body  of message> 
> 
>         EOF
          ^^^

>         close(SENDMAIL) or warn "sendmail didn't close nicely"; exit ;
> -----------------------------------------------
> 
> 
> It gives the follg error.
> 
> 
> -------------------------------------------
> 
> Can't find string terminator "EOF" anywhere 
> before EOF at send.pl line 4. 
> 
> -------------------------------------------
> 
> any pointers ?


The EOF which I've underscored above must be at the very beginning
of the line.


print SENDMAIL<<EOF;
	# stuff
EOF


Cheers,
Bernard


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

Date: Thu, 25 Oct 2001 14:58:40 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Plaintext to passwd file?
Message-Id: <9r92rp$vdb$05$1@news.t-online.com>

"Logan Shaw" <logan@cs.utexas.edu> schrieb im Newsbeitrag
news:9r7ju2$fiq$1@charity.cs.utexas.edu...

[snip]

| The reason salts exist is to make that optimization either useless or
| at least much less useful.  The salt is a piece of data that is used to
| modify the encryption process, so that encrypting with two different
| salts actually means you're using two different (although related)
| encryption functions.

[snip]

Thanks for the introduction to encryption. ;)
This passage included the missing piece of information.

Steffen
--
$_=q;33352987319029872958319011313364356732192639127636833335345138283712
3712336415083973397340602842912;;s;\n;;;print"\n";$o=$_;push@o,substr($o,
$_*4,4)for(0..24);pop@o;for(@o){$i++;print' 'x(26-$i).(chr$_/29-$i)."\n"}





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

Date: Thu, 25 Oct 2001 14:35:41 -0000
From: David Wall <darkon@one.net>
Subject: Re: Plaintext to passwd file?
Message-Id: <Xns91456BAECF5DFdarkononenet@207.126.101.97>

logan@cs.utexas.edu (Logan Shaw) wrote on 24 Oct 2001:

> In article <Xns9144E8852CDDEdarkononenet@24.2.68.108>,
> David K. Wall <darkon@one.net> wrote:
> 
>>I don't see how picking different salts each time makes things any
>>more difficult, since anyone will know what the salt is by picking off
>>the first two characters of the encrypted string.  Or am I missing
>>something? 
> 
> It's not that the attacker has to guess the salt.  He knows the salt,
> but it still makes the attacker's life more difficult.
[example making the idea clear.  i.e., if you use different salts for each 
password, a cracker can't encrypt a password once and then compare it to 
each of the encrypted passwords.  Instead, s/he has to encrypt it using 
the salt that was used for that particular password.]

Thanks, Logan.  It's obvious now that you've explained it.

(and thanks to MJD for his explanation as well.)

-- 
David Wall
darkon@one.net


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

Date: Thu, 25 Oct 2001 14:38:33 -0000
From: David Wall <darkon@one.net>
Subject: Re: Plaintext to passwd file?
Message-Id: <Xns91456C2B52214darkononenet@207.126.101.97>

"Steffen Müller" <tsee@gmx.net> wrote on 25 Oct 2001:

> "Logan Shaw" <logan@cs.utexas.edu> schrieb im Newsbeitrag
> news:9r7ju2$fiq$1@charity.cs.utexas.edu...
> 
>| The reason salts exist is to make that optimization either useless or
>| at least much less useful.  The salt is a piece of data that is used
>| to modify the encryption process, so that encrypting with two
>| different salts actually means you're using two different (although
>| related) encryption functions.
> 
> Thanks for the introduction to encryption. ;)
> This passage included the missing piece of information.

Yeah, I carelessly didn't pay very close attention to it, and so asked for 
clarification.  D'oh!

-- 
David Wall
darkon@one.net


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

Date: Thu, 25 Oct 2001 14:41:51 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: Reading different string input
Message-Id: <3BD8169F.787C25D0@oracle.com>

This is a multi-part message in MIME format.
--------------80930106150AADE4E2449C8E
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Martin wrote:

> $input = "pcNameInOffic";
> $input = "pcUnitName.20.24.20.20.4.0.0";
>
> If the input has a format like  pcNameInOffic, i want to save it in
> $nameInput, and
> If the input has a format like pcUnitName.20.24.20.20.4.0.0 i want to save
> its content in $unitInput.

You need to use regular expressions to identify the format of the input string
then save it into the relevant variable

# matches any word characters followed by 7 instances of a "." followed by one
or 2 digits

if($input =~ /\w+(\.\d\d?){7}/){
       $unitInput = $input;
}
else{
     $nameInput=$input;
}

See perldoc perlre for a description of regular expressions.

Graham Wood

--------------80930106150AADE4E2449C8E
Content-Type: text/x-vcard; charset=UTF-8;
 name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
 filename="Graham.T.Wood.vcf"

begin:vcard 
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard

--------------80930106150AADE4E2449C8E--



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

Date: Thu, 25 Oct 2001 13:10:36 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: What's wrong with File::Find
Message-Id: <3BD80DE9.16705ED8@acm.org>

Ian Boreham wrote:
> If @myargs is a lexically scoped variable when the anonymous sub is
> created, then you have a closure. What the anonymous sub does with it
> (passing it by value) doesn't affect this.

OK, give in. I had to work pretty hard to contrive an example in which
the reference to the anonymous sub could be called after @myargs had gone
out of scope, but it does indeed work as a closure. Basically, "find" (or
whatever sub is used in this position) would have to stuff the subref into
a variable outside its own scope, from which someone else could call it
later.

However File::Find doesn't do this, so the fact that this anonymous sub
is a closure is of no consequence whatsoever.

And I still maintain that "not all anonymous subs are closures" as defined
in the Perl documentation.

-- Dave Tweed


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

Date: Thu, 25 Oct 2001 14:12:57 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: What's wrong with File::Find
Message-Id: <3BD81C85.CEF6B931@acm.org>

"Alexander Farber (EED)" wrote:
> just anon subs are okay to me, but the closures are not - because
> I believe that closures (the anon subs referencing outer lexical vars)
> aren't very effective and waste memory - please see the example at
> http://perl.apache.org/guide/perl.html#Understanding_Closures_the_Ea

Which, as I pointed out to Ian, is of no consequence in this instance,
since File::Find doesn't keep the subref around any longer than it needs
to. You do not get separate coderefs and lexical variable bindings
cluttering up your memory space.

> That's why I think, it's pity that File::Find doesn't support passing
> arguments to the wanted sub - it would be so easy to implement.

Then Just Do It. Modules are there to make your life easier, not to
constrain it. Feel free to make a private clone of File::Find that
does what you want, or grow your own tree-walker that includes only
the features you need.

-- Dave Tweed


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

Date: 25 Oct 2001 14:34:02 GMT
From: frank_mckenney@mindspring.com (Frank McKenney)
Subject: Win32 Perl book/software suggestions?
Message-Id: <9r97sq$a2o$1@slb6.atl.mindspring.net>


A friend provided me with a lot of free assistance on a recent
customer project.  Using the principle that "no good deed goes
unpunished" (;-), I'd like to put together a package to impress him
with, and help him learn, Perl.

He's fairly experienced in mainframe and desktop computer
programming, all the way from APL and FORTRAN through various ASMs 
to his current "favorite" Clipper/FiveWin in the Win32 environment.

I've been learning/using Perl under Linux (SuSE), but I know that
ports are available for Win32.  O'Reilly's "Learning Perl" is a good
start, but (IMNSHO) it isn't enough in itself to really impress
someone who is already doing GUI-based programming in another
environment.  Is there a "Perl/GUI for Win9x Programmers" out there
that might offer this?

He has occasionally mentioned a desire to move from Clipper to
something else, but he's good enough with what he already knows that
he'll be slow to learn something new unless the replacement offers
clear advantages over what he's doing now.  This is probably true of
most of us (;-), but in this case I'm willing to invest some extra
effort to make sure he gives Perl a good look.

Any suggestions?

How do you all go about impressing/educating co-workers and IT 
people of the advantages of Perl?


Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney aatt mindspring ddoott com



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

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


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