RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread David le Blanc
aman, Check out sudo's 'NOPASSWD' option. IT allows the admin to give you (or the source account) access to 'sudo -u target_account "command"' without entering a password. The SET UID script thing should not work. If it does, upgrade your OS for security reasons :-) Cheers. -Original M

Re: how do modules work?

2004-02-17 Thread Andrew Gaffney
R. Joseph Newton wrote: Andrew Gaffney wrote: This is what I didn't quite understand. I didn't realize that Perl's "black magic" allowed the blessed reference to refer back to the object already in memory. In effect, the blessed reference carries around the entire class object with it. Not qui

Re: How to implement container class/collection/managed list

2004-02-17 Thread R. Joseph Newton
"Michael C. Davis" wrote: > Hi list, > > Can anyone recommend a CPAN or Perl core module that implements a container > class / collection / managed list or somethign like that. I've found a > couple that I'm about to study now: > > Tie::Collection > Class::Composite > Clas

Re: how do modules work?

2004-02-17 Thread R. Joseph Newton
Andrew Gaffney wrote: > > This is what I didn't quite understand. I didn't realize that Perl's "black magic" > allowed > the blessed reference to refer back to the object already in memory. In effect, the > blessed reference carries around the entire class object with it. Not quite. The beauty

Re: how do modules work?

2004-02-17 Thread R. Joseph Newton
Andrew Gaffney wrote: > For example, if my module has 'use SomeModule;' and a script I write has 'use > MyModule;', > does > that mean that I am effectively saying 'use SomeModule;' in my script? Yes. From the point where you call the first module, your script will also any module used by that

Re: Why does this keep happening?

2004-02-17 Thread R. Joseph Newton
Joel wrote: > Thanks, but what does "My" mean That is my, not My. Perl is case-sensitive. It is the declaration of the identifier as a varaible within the current scope, rather than one imported from a larger outside scope. Until you understand the reasons to do this, go ahead and take it on

Re: how do modules work?

2004-02-17 Thread Andrew Gaffney
drieux wrote: On Feb 17, 2004, at 5:07 PM, Andrew Gaffney wrote: In my module, I created a function that connects to a MySQL database and then returns a DB handle. In the script that receives the DB handle, I removed the 'use DBI;' line. I can make queries against the database without problems.

Re: how do modules work?

2004-02-17 Thread Wiggins d'Anconia
Andrew Gaffney wrote: Wiggins d'Anconia wrote: [snip] And you may want to consider the Learning Perl Objects, References, and Modules from O'Reilly... I will look into it. I've already read Learning Perl and I own Perl Cookbook, Advanced Perl Programming, and the Perl Pocket Reference, which

Re: how do modules work?

2004-02-17 Thread Andrew Gaffney
Wiggins d'Anconia wrote: [EMAIL PROTECTED] wrote: You are in fact using the DBI module. The DB handle is probably (I think it is) a bless reference that will send you straight to the DBI module that's called in the function you've created. Although you're not using the DBI module in your code,

Re: how do modules work?

2004-02-17 Thread drieux
On Feb 17, 2004, at 5:07 PM, Andrew Gaffney wrote: In my module, I created a function that connects to a MySQL database and then returns a DB handle. In the script that receives the DB handle, I removed the 'use DBI;' line. I can make queries against the database without problems. Why does this

Re: array assistance needed

2004-02-17 Thread Wiggins d'Anconia
Paul Kraus wrote: Oh yea check out perldoc perllol. Excellent advice, in addition, perldoc perldsc perldoc perlreftut perldoc perlref http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how do modules work?

2004-02-17 Thread WilliamGunther
In a message dated 2/17/2004 8:56:07 PM Eastern Standard Time, [EMAIL PROTECTED] writes: and then in step 3 black magic happens and..." to your answer. We all know step 3 of any Perl code is black magic. Step 4 is optimization. Will

Re: how do modules work?

2004-02-17 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: You are in fact using the DBI module. The DB handle is probably (I think it is) a bless reference that will send you straight to the DBI module that's called in the function you've created. Although you're not using the DBI module in your code, you're indirectly using it

Re: how do modules work?

2004-02-17 Thread WilliamGunther
You are in fact using the DBI module. The DB handle is probably (I think it is) a bless reference that will send you straight to the DBI module that's called in the function you've created. Although you're not using the DBI module in your code, you're indirectly using it without ever knowing it

Re: how do modules work?

2004-02-17 Thread Andrew Gaffney
I completely understand the way the Perl's namespaces work. Here is what confused me. In my module, I created a function that connects to a MySQL database and then returns a DB handle. In the script that receives the DB handle, I removed the 'use DBI;' line. I can make queries against the databa

How to implement container class/collection/managed list

2004-02-17 Thread Michael C. Davis
Hi list, Can anyone recommend a CPAN or Perl core module that implements a container class / collection / managed list or somethign like that. I've found a couple that I'm about to study now: Tie::Collection Class::Composite Class::Container Is there such a module that a

Re: Why does this keep happening?

2004-02-17 Thread WilliamGunther
#!/usr/bin/perl use strict; use warnings; my $abc = 1000; until ($abc == 0) { print "Counting down to 0 from $abc\n"; --$abc; }; print "Blast off!\n"; Remember your semicolons and try to use strict. I try to be readable above all else. Because then at least if the code doesn't work,

RE: how do modules work?

2004-02-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Andrew Gaffney wrote: > I've been using Perl for about a year. I'm writing my own module that > contains some custom functions that I use a lot. In doing this, I > started wondering how modules work. For example, if my module has > 'use SomeModule;' and a script I write has 'use MyModule;', does th

Re: how do modules work?

2004-02-17 Thread WilliamGunther
That would be true in some languages. Not in Perl. Modules only "exist" in the lexical scope (usually a block, in this case a file/package). So, there's no danger in polluting namespace from that module for sure. But, as with everything else in Perl, you can access it if you go out of your way.

how do modules work?

2004-02-17 Thread Andrew Gaffney
I've been using Perl for about a year. I'm writing my own module that contains some custom functions that I use a lot. In doing this, I started wondering how modules work. For example, if my module has 'use SomeModule;' and a script I write has 'use MyModule;', does that mean that I am effective

Re: connecting to a mail server via IMAP

2004-02-17 Thread R. Joseph Newton
John wrote: > Is it neseccary to authenticate the smtp host? Aah, what kind of attachments are you needing to send? Something about your line of inquiry is disquieting. For what it is worth this is quickly becoming more difficult. This is fortunate. There is no good reason for any e-mail to b

Re: DBI and MS Access

2004-02-17 Thread Robert
Andrew Gaffney wrote: Andrew Gaffney wrote: Is there a DBD module for Microsoft Access databases? I've searched around on search.cpan.org, but I haven't come across anything. Let me elaborate. This will be from Linux, so the Windows ODBC interface to Access isn't an option. http://www.unixod

Re: Why does this keep happening?

2004-02-17 Thread Robert
YOURS: #!usr/bin/perl $abc=1000 until ($abc==0) { print "Counting down to 0 from $a\n"; $a--; } print "Blast off!"; MINE: #!usr/bin/perl use strict; use warnings; my $abc = 1000; until ($abc == 0) { print "Counting down to 0 from $abc\n"; $abc--; } print "Blast off!"; hint #1: Watch o

Re: Why does this keep happening?

2004-02-17 Thread Daniel Staal
--As of Tuesday, February 17, 2004 5:28 PM -0500, Joel is alleged to have said: I fixed the source code with the suggestions given, but still no luck. Any other ideas? Joel --- # !usr/bin/perl $abc=1000 Still need a semicolon... (and a 'my', for preference.

Re: DBI and MS Access

2004-02-17 Thread Rob Dixon
Andrew Gaffney wrote: > > Is there a DBD module for Microsoft Access databases? I've searched around on > search.cpan.org, but I haven't come across anything. You can use DBD::ODBC to connect using DSN. Will that do? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: DBI and MS Access

2004-02-17 Thread Andrew Gaffney
Andrew Gaffney wrote: Is there a DBD module for Microsoft Access databases? I've searched around on search.cpan.org, but I haven't come across anything. Let me elaborate. This will be from Linux, so the Windows ODBC interface to Access isn't an option. -- Andrew Gaffney Network Administrator Sky

DBI and MS Access

2004-02-17 Thread Andrew Gaffney
Is there a DBD module for Microsoft Access databases? I've searched around on search.cpan.org, but I haven't come across anything. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Regex to find group of image files

2004-02-17 Thread Rob Dixon
B. Fongo wrote: > > I'm having tough time trying to solve a problem at some regex. I have > several pictures for cars, and want to use a script to create some HTML > files using those pictures. > For each car, I have three pictures named e.g. jeep.1.jpg, jeep.2.jpg > and jeep.3.jpg. > > What am try

RE: Why does this keep happening?

2004-02-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Joel wrote: > I fixed the source code with the suggestions given, but still no > luck. Any other ideas? > > Joel > --- > #!usr/bin/perl > > $abc=1000 > > until ($abc==0) > { > print "Counting down to 0 from $a\n"; > $a--; > } > print "Blast off!"; This doe

RE: array assistance needed

2004-02-17 Thread jeffrey_n_Dyke
> I'd like to create a numerically indexed associtative array, each key will > contain an array of three elements like: > > $array[0] = ("element0", "element1", "element2"); > $array[1] = ("element0", "element1", "element2"); > $array[3] = ("element0", "element1", "element2"); > etc. >>Why us

Re: Why does this keep happening?

2004-02-17 Thread Joel
I fixed the source code with the suggestions given, but still no luck. Any other ideas? Joel --- #!usr/bin/perl $abc=1000 until ($abc==0) { print "Counting down to 0 from $a\n"; $a--; } print "Blast off!"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Why does this keep happening?

2004-02-17 Thread Joel
Thanks, but what does "My" mean and why did you use "print" twice in a row? Joel - Original Message - From: "Dan Muey" <[EMAIL PROTECTED]> To: "Joel" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 5:15 PM Subject: RE: Why does this keep happening? > I

RE: Why does this keep happening?

2004-02-17 Thread Bakken, Luke
> -Original Message- > Subject: Why does this keep happening? > > I'm running perl under windows XP and I keep geting this error: > > syntax error at (Directory and filename) Line 6, near " ) > {" > syntax error at (directory and filename) line 9 near "}" > > The source code is below, bu

RE: Why does this keep happening?

2004-02-17 Thread Dan Muey
> I'm running perl under windows XP and I keep geting this error: > > syntax error at (Directory and filename) Line 6, near " ) > {" > syntax error at (directory and filename) line 9 near "}" > > The source code is below, but this happens with loops in > general. Any ideas? > > ---

RE: Why does this keep happening?

2004-02-17 Thread Bob Showalter
Joel wrote: > I'm running perl under windows XP and I keep geting this error: > > syntax error at (Directory and filename) Line 6, near " ) > {" > syntax error at (directory and filename) line 9 near "}" > > The source code is below, but this happens with loops in general. Any > ideas? > >

Why does this keep happening?

2004-02-17 Thread Joel
I'm running perl under windows XP and I keep geting this error: syntax error at (Directory and filename) Line 6, near " ) {" syntax error at (directory and filename) line 9 near "}" The source code is below, but this happens with loops in general. Any ideas? -

RE: array assistance needed

2004-02-17 Thread Paul Kraus
Oh yea check out perldoc perllol. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: array assistance needed

2004-02-17 Thread Paul Kraus
> I'd like to create a numerically indexed associtative array, each key will > contain an array of three elements like: > > $array[0] = ("element0", "element1", "element2"); > $array[1] = ("element0", "element1", "element2"); > $array[3] = ("element0", "element1", "element2"); > etc. Why use an a

Re: shorten code

2004-02-17 Thread Jan Eden
James Edward Gray II wrote: >On Feb 17, 2004, at 3:13 PM, Jan Eden wrote: > >> >> Rob Dixon wrote: >>> >>> my @data = map { tr/%//d; [split] } split /\n/, $str; >>> >> >> A little late maybe, but... >> >> Why do you have the second (in the order of operation) split operator >> in brackets? Shou

Re: shorten code

2004-02-17 Thread James Edward Gray II
On Feb 17, 2004, at 3:13 PM, Jan Eden wrote: Rob Dixon wrote: my @data = map { tr/%//d; [split] } split /\n/, $str; A little late maybe, but... Why do you have the second (in the order of operation) split operator in brackets? Shouldn't it just split $_ on whitespace if no arguments are given

array assistance needed

2004-02-17 Thread jeffrey_n_Dyke
I have some syntax questions in regards to populating/iterating through hashes/arrays. I've been writing PHP for about 4 years, and haven't written any PERL in about the same time i'd like to create a numerically indexed associtative array, each key will contain an array of three elements lik

Re: shorten code

2004-02-17 Thread Jan Eden
Rob Dixon wrote: > > my @data = map { tr/%//d; [split] } split /\n/, $str; > A little late maybe, but... Why do you have the second (in the order of operation) split operator in brackets? Shouldn't it just split $_ on whitespace if no arguments are given? - Jan -- If all else fails read the

Regex to find group of image files

2004-02-17 Thread B. Fongo
Hello I'm having tough time trying to solve a problem at some regex. I have several pictures for cars, and want to use a script to create some HTML files using those pictures. For each car, I have three pictures named e.g. jeep.1.jpg, jeep.2.jpg and jeep.3.jpg. What am trying to do now, is to u

Re: FW: Extract Data from Excel-files

2004-02-17 Thread Benjamin Walkenhorst
Hello, I started working on the excel-files today, Spreadsheet::ParseExcel works great! Kind regards, Benjamin -- If you want to know what god thinks of money, just look at the people he gave it to. -- Dorothy Parker -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Import oddity

2004-02-17 Thread Steve Grazzini
Dan Muey wrote: Any thoughts? Erm, it looks okay. Maybe if you showed a complete example and the error or warnings (or misbehavior) somebody would see the problem. Here's what I was using. BEGIN { package Foo; use base qw(Exporter); use strict; our @EXPORT_OK =

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Alright, i would like to listen about the possibility of the authentication as far as i am not a spammer. - Original Message - From: "Daniel Staal" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 8:07 PM Subject: Re: connecting to a mail serv

Re: Flushing FileHandle's Buffer

2004-02-17 Thread Rob Dixon
Balaji thoguluva wrote: > >I would like to know if there is a function(other > than close FILEHANDLE) to flush current filehandle's > buffer data to the file. In otherwords, I want to make > sure the following PRINT statement to work immediately > after its execution. > > print FILEHANDLE "Flus

RE: Import oddity [SOLVED!]

2004-02-17 Thread Dan Muey
> Dan Muey wrote: > > Any thoughts? > > Erm, it looks okay. Maybe if you showed a complete example > and the error or warnings (or misbehavior) somebody would see > the problem. > > Here's what I was using. > > BEGIN { > package Foo; > use base qw(Exporter); >

Re: connecting to a mail server via IMAP

2004-02-17 Thread Daniel Staal
--As of Tuesday, February 17, 2004 7:42 PM +0200, John is alleged to have said: Relaying denied. What is that? The sever doesn't allow you to connect to send mail through it. (You can send mail *to* it, or *from* it, probably, but not *through* it.) Could i connect to any smtp server i want.

Flushing FileHandle's Buffer

2004-02-17 Thread Balaji Thoguluva
Hi, I would like to know if there is a function(other than close FILEHANDLE) to flush current filehandle's buffer data to the file. In otherwords, I want to make sure the following PRINT statement to work immediately after its execution. print FILEHANDLE "Flush this data IMMEDIATELY to the fil

RE: Import oddity

2004-02-17 Thread Dan Muey
> > Dan Muey wrote: > > Any thoughts? > > Erm, it looks okay. Maybe if you showed a complete example > and the error or warnings (or misbehavior) somebody would see > the problem. > > Here's what I was using. > > BEGIN { > package Foo; > use base qw(Exporter); >

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Relaying denied. What is that? Could i connect to any smtp server i want. Please enlighten me! - Original Message - From: "Wiggins d Anconia" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]>; "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 6:40 PM Subject: Re:

Re: connecting to a mail server via IMAP

2004-02-17 Thread Jenda Krynicky
From: Daniel Staal <[EMAIL PROTECTED]> > --As of Tuesday, February 17, 2004 4:58 PM +0200, John is alleged to > have said: > > > Here is my code > > Thanks. ;-) > > >#!/usr/bin/perl -w > > use strict; > > > use Mail::Sender; > > $sender = new Mail::Sender({smtp => 'mymailserver', from => >

RE: Import oddity

2004-02-17 Thread Dan Muey
> Dan Muey wrote: > > I tried both and no go. All is well (IE the thigns specified > > are Exported to the script) if I do not have > strict->import; (Which makes > > the script act as if they had 'use strict;' in the script) > > Did you "use strict" or "require strict" anywhere? > package Foo

Re: Import oddity

2004-02-17 Thread Steve Grazzini
Dan Muey wrote: I tried both and no go. All is well (IE the thigns specified are Exported to the script) if I do not have strict->import; (Which makes the script act as if they had 'use strict;' in the script) Did you "use strict" or "require strict" anywhere? -- Steve -- To unsubscribe, e-mail:

Re: connecting to a mail server via IMAP

2004-02-17 Thread Wiggins d Anconia
PLEASE, bottom post... > Things getting better :) > > But what is the difference in Path and FileName in the attachment method? > Path is the location of the file on the local file system, FileName is used in the content-disposition header for providing a suggested name for the file on the reci

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Wiggins d Anconia
Please bottom post > Hi James, > > Thanks for the pointer to the Expect module. > > I'll set it up and hope I get it working...else I'll come running back to > you :p > > Can I establish an SSH connection and do something like Sshexec and Scp > tasks do in ant 1.6.x using Expect ? > > Than

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Thind, Aman
:) By the way your stress on avoiding to store the pswd in any readable disk file really made me look at my problem and possible solutions from a whole new perspective... Cheers ! -aman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 17 February 2004 21:53 To:

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Things getting better :) But what is the difference in Path and FileName in the attachment method? - Original Message - From: "Daniel Staal" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 6:10 PM Subject: Re: connecting to a mail server via

RE: [OT] Apache internal server redirects

2004-02-17 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I have an internal server that I need to pass external visitors to > from a web page. The internal server isn't set up to go through the > firewall so I am looking for a way to make web server (which does > play nice) to access the other server via http and let a user a

Re: How to su in a script if su needs a pswd ?

2004-02-17 Thread Randal L. Schwartz
> "Aman" == Thind, Aman <[EMAIL PROTECTED]> writes: Aman> I pass through the else block as you had earlier answered to one Joe Aman> Catanzaro though his question was strikingly similar to mine. I just find it odd that nobody asks a question like that for at least six months in my recollectio

RE: Import oddity

2004-02-17 Thread Dan Muey
> Dan Muey wrote: > >>sub import { > >>my $class = shift; > >>$class->SUPER::import(@_); > >>strict->import; > >>} > >> > >> I believe that will fix it. Not 100% sure though. Never > >> tried it. ;) > > > > I just tried it and no go. Any other thoughts anyone? > > The problem here

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Thind, Aman
Hello Randal, In your - If ( aman eq "same person who asked in a diff forum") { print "JERK"; } Else { print "Valuable archive of answers to similar question" ; } I pass through the else block as you had earlier answered to one Joe Catanzaro though his question was strikingly sim

Re: connecting to a mail server via IMAP

2004-02-17 Thread Daniel Staal
--As of Tuesday, February 17, 2004 5:53 PM +0200, John is alleged to have said: Unfortunately, MIME::Lite requires Sendmail on the host. --As for the rest, it is mine. Actually, no. It just uses it by default... You can say: $msg->send('smtp'); #Uses the default smtp server. or: $msg->send('s

RE: [OT] Apache internal server redirects

2004-02-17 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I have an internal server that I need to pass external visitors to > from a web page. The internal server isn't set up to go through the > firewall so I am looking for a way to make web server (which does > play nice) to access the other server via http and let a user ac

Re: Import oddity

2004-02-17 Thread Steve Grazzini
Dan Muey wrote: sub import { my $class = shift; $class->SUPER::import(@_); strict->import; } I believe that will fix it. Not 100% sure though. Never tried it. ;) I just tried it and no go. Any other thoughts anyone? The problem here is that Exporter::import() looks at th

Re: How to su in a script if su needs a pswd ?

2004-02-17 Thread Randal L. Schwartz
> "Aman" == Aman Thind <[EMAIL PROTECTED]> writes: Aman> I am running a command as part of my script on a Unix box for which I need Aman> to su to a different username. Aman> This su requires a password as well. A question just like this was posted to the Perl-Beginners Yahoo mailing list.

RE: [OT] Apache internal server redirects

2004-02-17 Thread [EMAIL PROTECTED]
Well how about this: http://publicserver.com/privateserver.pl Then privateserver.pl could grab content from the local files/scripts. HTH Dmuey Essentially I have live data feeds (cameras) that have an internal server. I want to link them to a web page from our intranet server (user/pw used to

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Unfortunately, MIME::Lite requires Sendmail on the host. - Original Message - From: "Daniel Staal" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 5:26 PM Subject: Re: connecting to a mail server via IMAP > --As of Tuesday, February 17, 200

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Thind, Aman
Hi James, Thanks for the pointer to the Expect module. I'll set it up and hope I get it working...else I'll come running back to you :p Can I establish an SSH connection and do something like Sshexec and Scp tasks do in ant 1.6.x using Expect ? Thanks -aman -Original Message- From: Kip

RE: Import oddity

2004-02-17 Thread Dan Muey
> On Feb 17, 2004, at 7:56 AM, Dan Muey wrote: > > > Hello, > > > > Weird thing here: > > > > I get a variable from a module via @EXPORT_OK > > like so: > > > > use Foo::Monkey '$howdy'; # import the variable $howdy > > print $howdy; > > > > Works perfect. > > > > Now if I add strict->import; to m

Re: connecting to a mail server via IMAP

2004-02-17 Thread Daniel Staal
--As of Tuesday, February 17, 2004 4:58 PM +0200, John is alleged to have said: Here is my code Thanks. ;-) #!/usr/bin/perl -w use strict; use Mail::Sender; $sender = new Mail::Sender({smtp => 'mymailserver', from => '[EMAIL PROTECTED]'}); $sender->MailFile({to => '[EMAIL PROTECTED]', sub

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Hello, First of all i use perl for windows. Well, i what i really want to do is the following There is an SMTP Server There is a File Keeper Server (unix) There are some hosts (win32) The program i want to be able to send an email from the SMTP server attaching some files from the File Keepr

Re: How to su in a script if su needs a pswd ?

2004-02-17 Thread Wiggins d Anconia
> > Hello, > > I am running a command as part of my script on a Unix box for which I need > to su to a different username. > > This su requires a password as well. > > I could not find any option of passing the password in su. > > Tried the shell script solution of here docs : > > su < admin

AW: Chdir doesn't work under Apache?

2004-02-17 Thread Renger van Nieuwkoop
Thanks so much, David Apache was running as 'local system' and now runs with the appropriate user (never knew that you could run Apache in these different ways..) The script now runs fine. Renger -Ursprungliche Nachricht- Von: David le Blanc [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 17

Re: Import oddity

2004-02-17 Thread James Edward Gray II
On Feb 17, 2004, at 7:56 AM, Dan Muey wrote: Hello, Weird thing here: I get a variable from a module via @EXPORT_OK like so: use Foo::Monkey '$howdy'; # import the variable $howdy print $howdy; Works perfect. Now if I add strict->import; to my module's import function like so: I think "add" is

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Here is my code #!/usr/bin/perl -w use Mail::Sender; $sender = new Mail::Sender({smtp => 'mymailserver', from => '[EMAIL PROTECTED]'}); $sender->MailFile({to => '[EMAIL PROTECTED]', subject => 'Here is the file', msg => "I'm sending you the list you wanted."}); john, john2 usernames exis

Import oddity

2004-02-17 Thread Dan Muey
Hello, Weird thing here: I get a variable from a module via @EXPORT_OK like so: use Foo::Monkey '$howdy'; # import the variable $howdy print $howdy; Works perfect. Now if I add strict->import; to my module's import function like so: package Foo::Monkey;; [ standard goodies cut] use base qw(Ex

RE: [OT] Apache internal server redirects

2004-02-17 Thread Dan Muey
> I have an internal server that I need to pass external > visitors to from a web page. The internal server isn't set > up to go through the firewall so I am looking for a way to > make web server (which does play nice) to access the other > server via http and let a user access the files and

Re: connecting to a mail server via IMAP

2004-02-17 Thread Daniel Staal
--As of Tuesday, February 17, 2004 4:17 PM +0200, John is alleged to have said: Is it neseccary to authenticate the smtp host? It depends on the host. ;-) testing the first sample script i saw no results. Where is the problem? We'll need more information than that... I assume you were trying

[OT] Apache internal server redirects

2004-02-17 Thread [EMAIL PROTECTED]
I have an internal server that I need to pass external visitors to from a web page. The internal server isn't set up to go through the firewall so I am looking for a way to make web server (which does play nice) to access the other server via http and let a user access the files and programs on it

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Is it neseccary to authenticate the smtp host? testing the first sample script i saw no results. Where is the problem? - Original Message - From: "Thind, Aman" <[EMAIL PROTECTED]> To: "'John'" <[EMAIL PROTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004

RE: Chdir doesn't work under Apache?

2004-02-17 Thread David le Blanc
The first three things to note: 1) CHDIR to C: works, CHDIR to UNC paths (//server/what/the/file) cannot and will not. *Map a drive* or use it as a path (ie, direct all commands to '$directories/stuff'. 2) Make sure the user running APACHE as a user, and not 'local system', and make sure tha

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Kipp, James
> Hello, > > I am running a command as part of my script on a Unix box for > which I need > to su to a different username. > > This su requires a password as well. > > I could not find any option of passing the password in su. > > Tried the shell script solution of here docs : > > su < admin

RE: data filtering

2004-02-17 Thread David le Blanc
Based on what you have described, the code below will generate an expression string from a series of filter requirements. #!/usr/bin/perl sub expr_tostr{ (my $expr = shift) =~s/\s+//g; @c = split /([<=>]+)/, $expr; @flop{("<","<=",">",">=")}=(">",">=","<","<=");

RE: connecting to a mail server via IMAP

2004-02-17 Thread Thind, Aman
I don't think you can send attachments using Net::SMTP. Use Mail::Sender by Jenda Krynickyit works ! And what's best is that Jenda is always around in this list raring to help...so u've got real time support ;-) And yes you do indeed need a mail server to connect to... Cheers -aman -O

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Using Net::SMTP can i send an email from my machine? Or Net::SMTP will enable to me to connect to a mail server and send email with attachements? - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 3:10 PM Subject: Re: connec

How to su in a script if su needs a pswd ?

2004-02-17 Thread Thind, Aman
Hello, I am running a command as part of my script on a Unix box for which I need to su to a different username. This su requires a password as well. I could not find any option of passing the password in su. Tried the shell script solution of here docs : su <

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
I tried to connect to an imap server via the sample script that Mail::IMAPClient document provides and i recieved the following error. Mail::IMAPClient not using Fast_IO; not available on this platform at imap_test.pl line 15 - Original Message - From: "John" <[EMAIL PROTECTED]> To: "P

Re: connecting to a mail server via IMAP

2004-02-17 Thread Rob Dixon
John wrote: > > From: "Rob Dixon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, February 17, 2004 2:41 PM > Subject: Re: connecting to a mail server via IMAP > > > > > John wrote: > > > > > > Can perl connect to a mail server via imap and then send some > > > emails (with attacheme

Re: another directory search, yet many subdirs

2004-02-17 Thread Rob Dixon
Derek Smith wrote: > > I am in need of some help! Here is the info you need for my samba mount > points. > > directories: ~emstat/win32/backup/012004155140/pc*, > ~emstat/win32/backup/01210415175/pc*, ~emstat/win32/pc* > files: under each of these subdirs, pc[#], I have "training > 2001.em

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
So, could we send attachments using the Mail::IMAPClient? - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 2:41 PM Subject: Re: connecting to a mail server via IMAP > > John wrote: > > > > Can perl connect to a mail ser

RE: data filtering

2004-02-17 Thread David le Blanc
What are you expecting the user to enter as a requirement to filter the data? I think what you want is to make the expression *less* generic. Ie, make it specific to how your users enter filter requirements. If this is so, please elaborate. -Original Message- From: N, Guruguhan (GEAE

Re: connecting to a mail server via IMAP

2004-02-17 Thread Rob Dixon
John wrote: > > Can perl connect to a mail server via imap and then send some > emails (with attachements of course). John wrote: > > Has perl its own smpt to send mails? Hi John. You need Mail::IMAPClient and Net::SMTP. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: all matches of a regex

2004-02-17 Thread Rob Dixon
Öznur Tastan wrote: > > Your suggestion was quite helpful but I got stuck when I try to modify it for > general purpose. May be you will have an idea and want to help. > > The foreach $n( 1...length sequence) solves the combinatorial problem but the > combinations can happen in second or third case

subroutine parameter validation

2004-02-17 Thread Gary Stainburn
Hi folks, I've had a go a rolling my own subroutine validation code, and would welcome any constructive comments on it. My aim was to allow existing code to continue working using positional params, as well as allowing varieties of -key=>value style arguments. Gary #!/usr/bin/perl -w use str

Re: connecting to a mail server via IMAP

2004-02-17 Thread John
Has perl its own smpt to send mails? - Original Message - From: "David le Blanc" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 1:25 PM Subject: RE: connecting to a mail server via IMAP > > Probably can. Have you asked it? > > Does it have to be i

connecting to a mail server via IMAP

2004-02-17 Thread John
Can perl connect to a mail server via imap and then send some emails (with attachements of course)