how to parse the msqid_ds structure return from msgctl(ID, IPC_STAT, $msq_ds)

2006-04-25 Thread Eric Richardson

The docs state the following :

==
msgctl ID, CMD, ARG 
 

Calls the System V IPC function msgctl(2). You'll probably have to say

use IPC::SysV;


first to get the correct constant definitions. If CMD is IPC_STAT, then
ARG must be a variable which will hold the returned msqid_ds structure.
Returns like ioctl: the undefined value for error, "0 but true" for
zero, or the actual return value otherwise. See also perlipc/"SysV IPC",
IPC::SysV, and IPC::Semaphore documentation.

==

I have not found a way to dereference the msq_ds array returned as 
per
http://cpansearch.bulknews.net/markup/IPC_SysV/SysV.pm.   How is this
msqid_ds structure parsed?  Do you have a short example?

Thanks,
Eric


_
Scanned by Sanmina-SCI eShield  
_

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Script does not want to run, error

2003-03-05 Thread Eric Peers
Mel,

Renamer does not have execute permissions.  Do a chmod 755 renamer.pl.
Also the script is owned by root, so you will not be able to run it as
me.

Eric

-Original Message-
From: mel awaisi [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 2:34 PM
To: [EMAIL PROTECTED]
Subject: Script does not want to run, error


Hi,

I am having problems opening this script on my machine. i have been
getting 
help from a very helpful person on this list.

I have checked the shebang line, that perl exists, and perl -v gives
proper 
output.

i try to run the script below as follow:

[EMAIL PROTECTED] httpd]# cd cgi-bin
[EMAIL PROTECTED] cgi-bin]# ls -la
total 28
drwxr-xr-x2 me   root 4096 Mar  5 21:49 .
drwxr-xr-x5 me   root 4096 Mar  3 01:50 ..
-rwxr-xr-x1 me   root  268 Mar  4 13:50 printenv
-rwxr-xr-x1 me   me   1792 Mar  5 15:20 renamer
-rwxr-xr-x1 me   me   1788 Mar  4 16:40 renamer.cgi
-rw---1 root root 1731 Mar  5 21:49 renamer.pl
-rwxr-xr-x1 me   root  757 Mar  3 01:50 test-cgi
[EMAIL PROTECTED] cgi-bin]# renamer.pl &
[1] 10254
[EMAIL PROTECTED] cgi-bin]# bash: renamer.pl: command not found

[1]+  Exit 127renamer.pl
[EMAIL PROTECTED] cgi-bin]#


[EMAIL PROTECTED] cgi-bin]# ./renamer.pl &
[1] 10297
[EMAIL PROTECTED] cgi-bin]# bash: ./renamer.pl: Permission denied

[1]+  Exit 126./renamer.pl
[EMAIL PROTECTED] cgi-bin]#

Regards,

Mel


_
Chat online in real time with MSN Messenger http://messenger.msn.co.uk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: broadcast photo on other site not by up load

2002-12-21 Thread eric lin

Dear Zentara:

  Now I am in linux again,
I did /usr/bin/perl  /usr/lib/cgi-bin/showphoto.pl > mytestout.jpg
then at netscape 7 's url type /home/fsshl/mytestout.jpg

it showed
---
The image "file:///home/fsshl/mytestout.jpg" cannot be displayed, 
because it contains errors




some body in perl-app mailing list told me they have a code did success 
broadcast by  Mac OSX perl 5.6.0 (ugh)


as show photo on other's site without download or any bottom click's 
hyperlink, but it now is so common, my site's counting banner is one 
example, a lots lists in ebay aution-computer product aution bidding P4
are another example , otherwise they can not have so flexible graphic 
page design just rely on 6 photo upload in ebay.

regard Eric-drop me a note if you can discover how to





Sorry, but it's hard to say what exactly your problem is, especially
because I don't use windows and don't know the peculiarities of
your windows apache server.
My suggestion is to work thru it step by step, until you
see where the problem is.
The first step is to get your script to output the image to
it's STDOUT. In other words, you should be able to do
"showphoto.pl > mytestout.jpg" and you should get
a good photo out.
Then you want to put it in your cgi-bin and try to
see where apache is messing up outputting the
photo. 
It usually ends up being something very simple,
which you are overlooking.





--
Sincere Eric
www.linuxspice.com
linux pc for sale


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: broadcast photo on other site not by up load

2002-12-20 Thread eric
Dear Zentara:

  I copy that piece of code and paste in my showphoto.pl in
C:\apache2\cgi-bin\
but it still not show any photo
attach my showphoto.pl
please help again

Sincere Eric
www.linuxspice.com
linux/window pc for sale

> >
> >http://www.linuxspice.com/cgi-bin/showphoto.pl";> 
>
> ##
> #!/usr/bin/perl
> use strict;
> print("Content-type:  Image/jpg\n\n");
>
> local $/ = undef; # file slurp mode
> open(INFILE, " my $img = ;
> close(INFILE);
> binmode STDOUT;
> print $img;
> exit;
> #
>
> If you put this in a script all of its own, then you can use it in an
> image tag when printing out your html like so:
> http://yourdomain.com/cgi-bin/showphoto.pl";>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



showphoto.pl
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


broadcast photo on other site not by up load

2002-12-19 Thread eric
Dear Perl advancer:

  I want to post a photo to a website, not mine, and not load to their local
disk, that is post directly from my site.

in their html webpage I add a line as

http://www.linuxspice.com/cgi-bin/showphoto.pl";> 

and in my C:/apache2/cgi-bin/showphoto.pl



#!c:\perl\bin\perl.exe
use strict;
use CGI qw(:standard);



print "Content-type:  text/html\n\n";


print "";

print " This is an exmaple CGI script.\n";


print "



 

";






print "";

but it still dispaly no photo as computer2G.jpg should have
I use http://www.mycompany.com/computer2G.jpg>   it
work if I click on that hyperlink

also
the following photo(counter banner) work not in the hostsite, but directly
broadcast from the banner's company work

-

http://counters.honesty.com/cgi-bin/honesty-counter.cgi?df=gen.000.0
4077>
Free counters provided by http://216.33.236.250/cgi-bin/linkrd?_lang=EN&lah=3d496a6e87fe66f92029f
79efa3ae737&lat=1039839856&hm___action=http%3a%2f%2fwww%2eandale%2ecom
target="_blank">Andale.

----


  Please help why my ideal is not work , thanks in advance

Sincere Eric
www.linuxspice.com
linux/window pc for sale


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: add new piece of html code in perl not success:internal server error

2002-12-19 Thread eric
src="https://www.paypal.com/images/x-click-but6.gif"; border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!">


so I put a line
print "src="https://www.paypal.com/images/x-click-but6.gif"; border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
";

it aparant show a piece of white in my IE6,

so I put \ in front of every " inside of print ",
like
print "src=\https://www.paypal.com/images/;

then, my browser show internal sever error

highly apprecaite any advancer's help

Sincere Eric
www.linuxspice.com
linux/window pc for sale


> Post that part of your code so people can help you.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




add new piece of html code in perl not success:internal server error

2002-12-19 Thread eric
Dear perl users:

  I want to copy a piece of html code to my site,

src="https://www.paypal.com/images/x-click-but6.gif"; border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!">


tthen it just show nothing( a piece of white) then I tried to put \ before
every "

then it have errror,
Internal Server ERror

  I know it is just this piece of new code make ghost.

  Please help

Sincere Eric
www.linuxspice.com
linux/window pc for sale


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




mod_perl & SQL

2002-06-28 Thread eric-perl

Hello, All:

Can anyone recommend a good introductory-level tutorial on writing
mod_perl modules that interface with SQL?

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Displaying Problems

2002-06-26 Thread eric-perl

On Tue, 25 Jun 2002, Kyle Babich wrote:
> Ok, I did like perldoc cgi said and changed it to this:
> 
> print start_html(
>   -title => "IMAP.cc",
>-head  => Link( 
>{ 
>-rel => "stylesheet",
>-type => "text/css",
>-href => "style.css",
>}
>),
>  -bgcolor => "\#FF"
>),
> 
> It still won't work though.

Kyle:

1. Are you able to execute *other* cgi scripts from this directory?
   Check your server's configuration.
2. Does this script have the permissions set correctly? The file itself
   must be executable before the Web server (i.e., mod_cgi) will
   execute the script.
3. Is the filename-extension correct to enable the server to recognize it 
   as executable? (e.g., '.cgi' vs '.pl')
4. Did you tell the OS how to execute this script? (e.g., #!/usr/bin/perl)

--
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to send an email without Net::SMTP

2002-06-07 Thread Eric Wang

Use Mail::Sendmail


Eric


On Wed, 5 Jun 2002, Octavian Rasnita wrote:

> Hi all,
>
> Is it complicated to send email with an SMTP mail server if the Net::SMTP
> module is not installed?
>
> Thank you.
>
> Teddy,
> [EMAIL PROTECTED]
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Content Warning from MailScan to Mail-Sender!

2002-06-04 Thread Eric Peers

Take a look at
http://www.symantec.com/avcenter/venc/data/w95.hybris.gen.html for details
about the worm.  Sadly, its no laughing matter.

Eric



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Send mail question

2002-05-17 Thread eric-perl

On Fri, 10 May 2002, fliptop wrote:
> Lance Prais wrote:
> > If I am going to sendmail from an Internet using CGI does anyone know all
> > the modules I will need to install?  This may answer all my questions.
> 
> i use mime::lite and it works great and is simple to use.

Ditto.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Counting the number of form fields returned with information

2002-04-18 Thread eric-sourceforge

On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote:
> What's the simplest way to make sure that all 10 fields have been 
> selected? I was hoping that...

A slightly shorter, more elegant solution:

#! /usr/bin/perl -w
use CGI qw(:standard);

use vars qw(%form_fields @missing);

%form_fields = (
company_name=>  'Company Name',
job_id  =>  'Job ID',
job_title   =>  'Job Title'
);
@missing = ();

print header(), start_html();
if (missing_params() == 0) {
print "All form-fields had values.";
} else {
print "These form-fields did not have values:", ol(li([@missing]));
}
print end_html();

sub missing_params {
foreach (keys %form_fields) {
next if defined param($_);
    push @missing,$form_fields{$_};
}
return scalar(@missing);
}


-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Counting the number of form fields returned with information

2002-04-18 Thread eric-sourceforge

On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote:
> What's the simplest way to make sure that all 10 fields have been 
> selected?

This seems pretty straight-forward: param() returns a list of all form 
elements - even the form elements without values. To check that each field 
contains a value.

#! /usr/bin/perl -w
use CGI qw(:standard);

use vars qw(%form_fields @missing);

# Create a hash of the HTML form element names and their labels
%form_fields = (
company_name=>  'Company Name',
job_id  =>  'Job ID',
job_title   =>  'Job Title'
);

print header(), start_html();
if (count_params() == scalar keys %form_fields) {
print "All form-fields had values.";
} else {
print "These form-fields did not have values:", ol(li([@missing]));
}
print end_html();

sub count_params {
# How many fields have been defined?
my $fields = scalar keys %form_fields;

# Loop through each field name and check the value. If no value was given: 
#  decrement the counter ($fields), and
#  push the field's label onto a list.
foreach (keys %form_fields) {
next if defined param($_);
push @missing,$form_fields{$_};
$fields--;
}
return $fields;
}


-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Counting the number of form fields returned with information

2002-04-17 Thread eric-sourceforge

Hello, All:

What's the simplest way to make sure that all 10 fields have been 
selected? I was hoping that...

  display_error_message() if param() < 10;

would work, but it doesn't seem to work correctly.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Using smtp

2002-04-17 Thread eric-sourceforge

On Wed, 17 Apr 2002, Bill Lyles wrote:
> How can I change this to smtp?

Bill:

Try using Mail::Mailer:

#!/usr/bin/perl -w
use Mail::Mailer;

my $To = $ARGV[0];
my $mailer = Mail::Mailer->new('smtp', 'your.smtp.host');
$mailer->open({
From => "[EMAIL PROTECTED]",
To   => $To,
Subject => "Password reminder for $To",
});
print $mailer $Message;
$mailer->close;

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Anyone? script was working now doesn't

2002-03-20 Thread Eric Peers

Teresa,

Is there more code in your script?  I can see that when submitting your form 
that the error condition below is running instead of some sort of cgi 
processing.  Might be helpful to see what is happening before or after this 
section of the script.

Eric

> From: Teresa Raymond <[EMAIL PROTECTED]>
>
> >Subject: script was working now doesn't
> >
> >The following script was working last night.  But now only puts up
> >my error msg.  It was putting up the error msg when I tried to run
> >the script via file path
> >(http://www.mariposanet.com/cgi-bin/contactnn.cgi) and continuing to
> >run the rest of the program if not.  No longer...
> >
> >Any thoughts?
> >
> >my $form=$q->param('contactform');
> >
> >#CHECK FOR FORM
> >unless (-e $form)
> >   {print <<"PrintTag";
> >
> >
> >Error!
> >
> ><!--
> >BODY {
> >background-color: #cc;
> >font-size: 12pt;
> >color: #66;
> >text-align: center
> >}
> >H1 {
> >font-size: 14pt
> >}
> >-->
> >
> >
> >
> >
> >Alert!
> >I'm sorry but you are forbidden to run this program without
> >filling out the form.
> >http://www.mariposanet.com/contactnn.html";>Contact
> > Form 
> >
> >
> >PrintTag
> >exit(0);
> >}
> >
> >
> >--
> >---
> >-  Teresa Raymond -
> >-  Mariposa Net   -
> >-  http://www.mariposanet.com -
> >---
> >
> >--
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Poll for my site

2002-03-19 Thread Eric Peers

-Original Message-
From: Henk van Ess [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 2:11 PM
To: [EMAIL PROTECTED]
Subject: Re: Poll for my site


I just uploaded this VERY simpele script, but whatever I try, it doesn't
work. I chmod'ed to 644,655,755,555,666 but it didn't run. What am I doing
wrong?

Your script runs fine from the commandline. Presuming you are running the
script below in a web browser, I've added one line of code:


#!/usr/bin/perl

# Fig. 2.1: fig02_01.pl

# A first program in Perl

print "Content-Type:text/html\n\n";

print "Welcome to Perl!\n"; # print greeting


Also check that you are running in a directory that allows scripts to
execute and that the web server recognizes the script extension.  All
assuming you are executing through a browser.

Eric

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: parsing a domain name out of an email address

2002-03-15 Thread Eric Peers

Thank you.  That helped get the script to compile.  Neither file is being
opened, but that me be a permissions issue.  I've expanded the code out a
bit (and made a correction to the if/then statement):

my $EmailAddress = $to;
if ($EmailAddress =~ (/^\w+\@aol\.com$/i)) {
my $msg = "/www/docs/sips_mar02aol.txt";
my $ContentType = "Content-Type: text/x-aol\n\n";
} else {
my $msg = "/www/docs/sips_mar02.html";
my $ContentType = "Content-Type: text/html\n\n";
}

open(MSG, "$msg") or die "Can't open $msg: $!\n";

print MAIL "To: $to\n";
print MAIL "From: $fromaddr\n";
print MAIL "Reply-to: $replyaddr\n" if $replyaddr;
print MAIL "X-Mailer: Perl Mailer\n";
print MAIL "Subject: $subject\n";
print MAIL "$ContentType";
while (my $text = ){
print MAIL "$text";
}
print MAIL "\n.\n";
close(MSG);

The purpose of the program is to email the contents of one of the files to a
requestor.  Aol has particular formatting needs if the email is being sent
other than text from outside their network.  Anyway, I'm certain why the the
script is failing to send the email.  I'm sure its something simple.

Eric


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




parsing a domain name out of an email address

2002-03-15 Thread Eric Peers

I'm attempting to parse a domain name out of a email address with the
following code:

my $EmailAddress = $to;
if ($EmailAddress =~ (/^\w+\@aol\.com)$/i){
my $msg = "/www/docs/sips_mar02aol.txt";
} else
my $msg = "/www/docs/sips_mar02.html";
}


Being new to regular expressions I'm not at all certain why this does not
work.

Thank you,

Eric


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: cookies

2002-03-11 Thread eric-perl

On Tue, 12 Mar 2002, Matthew Harrison wrote:
> #!/usr/bin/perl
> 
> use CGI qw/:standard/;
> $q = new CGI;
> print header();
> 
> $cookie = $q->cookie(-name=>'fontsize',
>       -value=>'12',
>       -expires=>'20s',

Matt:

You must print the output of CGI.pm to STDOUT. e.g., 

my $cookie = cookie(name => 'value');
print header($cookie),
start_html(),
h1('The Devil is in the details'), 
end_html();

I suggest that you read ALL of the example code.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: apple and oranges

2002-03-07 Thread eric-perl

On Wed, 6 Mar 2002, Fred Sahakian wrote:
> Im taking in data through a Perl Script with the following conversion:
> 
> $value = ~s/Apple/Orange/g;
> 
> This is fine for new data, but each time the program is run it's
> taking all the data being entered and turning the apples into oranges,
> any ideas how I get the program to ignore the original data?  Ive
> tried a variety of logic but have had no luck.

($new = $old) =~ s/apple/orange/;

will leave the original value alone and place the modified value in a 
separate variable.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Escaping special characters for regular expressions

2002-02-28 Thread eric-perl

On Wed, 27 Feb 2002, W  P wrote:
> I have a CGI script which takes two strings. It searches for the first
> string in a file, replacing it with the second one.  This file isn't
> really important, more for fun, so I'm not too worried about people
> deleting the whole file if they actually type out the contents as the
> first string.  However, I would like for things like . and \w to
> search for those string literals, rather than for any character or any
> word character, respectively.  Is there some function or capability
> which escapes all special characters in a string before it is passed
> to a regular expression?

To escape the '\w' just preprend another '\'.
To escape the '.' just prepent it with '\'.

e.g., $x =~ /\\w/ searches for a single back-slash followed by "w".
  $x =~ /\./ searches for a single period.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Session cookies

2002-02-27 Thread eric-perl

On Wed, 27 Feb 2002, Octavian Rasnita wrote:
> I want to set a cookie in a Perl script only for the current session, and I
> don't need that cookie after the visitor closes the browser.
> 
> Can I use this kind of cookie if the user has deactivated cookies in her
> browser?
> 
> I can't test this on my localhost, because even if I disable the cookies,
> they are set with no problem.

Octavian:

Again, I recommend that you read Linconln Stien's excellent book 
"The Definitive Guide to Using CGI.pm". (Setting cookies that expire at 
the end of the user's session only requires not setting any expiration 
date.)

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Uploading a file

2002-02-27 Thread eric-perl

On Wed, 27 Feb 2002, Octavian Rasnita wrote:
> I saw a question about how to make a Perl script for uploading a file
> and I didn't see any answer for it. I am also interested in this
> thing.
> 
> Could somebody give us some hints?
> Or, give us a source for a Perl script for uploading a file.
> 
> Thank you very much.
> Teddy,
> My dear email address is [EMAIL PROTECTED]

Octavian:

I recommend that you read Lincoln Stien's book (I belive that it's 
available on-line *somewhere*...) to learn more abokut uploading files 
using the CGI and perl. It's not complicated but it is a security risk.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Is it a problem?

2002-02-27 Thread eric-perl

On Wed, 27 Feb 2002, Octavian Rasnita wrote:

> Hi all,
> 
> I am new in Perl world, and I saw many messages telling that it is a
> security problem is someone can download the passwd file from a Unix
> machine.
> I have 2 questions:
> 1. As far as I know, that file has the passwords crypted and the person who
> download it won't see the real password.
> Or, are there guys who can break that protection?
> 2. If I run Apache under Windows 2k, do I still have this problem?

Octavian:

Yes - the passwd file (or the /etc/shadow file on most systems) must be 
protected because it is encrypted using a simple encryption method that 
could be decrypted if someone has enough time.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Things that make you go hmmmmmmmm

2002-02-26 Thread eric-perl

On Tue, 26 Feb 2002, Scot Robnett wrote:
> What typically causes the following type of error in a CGI?
> ---
> Use of uninitialized value in concatenation (.) 
> at D:\inetpub\whatever\census\myscript.cgi line 272.
> ---
>   
> 
> Line 272 is simply this:
> ---
> 272 print <<"END_OF_HTML";
> # some HTML here (line 273)
> # some more HTML here (line 274)
> # blah blah blah (etc.)
> END_OF_HTML 
> ---
Scott:

I'm just shootin' from the hip, but I don't think that...

1. the beginning token should be enclosed in quotes, or that
2. there should be a semi-colon after the first token.

For more info, check `perldoc -q HERE documents`. (It's a ways down the 
page...)

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Change first character of a string into Caps

2002-02-09 Thread Eric Pretorious

On Sat, 9 Feb 2002, Rene Verharen wrote:
> I need to change the first (and ONLY the first) character of a string into 
> Caps.  I know how to change the whole string into Caps by using this :
> 
> my $in = "this is my text";
> $out = uc $in;
Rene:

You're close. Use ucfirst() instead. 

To change the capitalization of several words (e.g., change 'eRic
preTorioUs' -> 'Eric Pretorious') try...

$foo =~ /(\w+)/\u\L$1/g;

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Image Galleries On-the-Fly

2002-02-08 Thread Eric Pretorious

On Fri, 8 Feb 2002, Eric Pretorious wrote:
> I'm hoping to build a CGI script that:
> 
> 1. creates a thumbnail index of .jpg files in a directory, and 
> 2. serves full-size images
> 
> wrapped in an HTML template, on-the-fly.

I found the Apache::Album modlue and read the readme.txt file but
still need some guidance on a few items:

1. Is there a module like Apache::Album that can be configured to wrap
every response in an HTML template?

2. Should I split the thumbnail/index-creation and full-sized image
response between two modules?

3. Is there a module that will add 'previous' and 'next' links to each
full-sized image so that users can view the entire series of images
without having to go back to the index after every image?

3. How can I set-up Apache to dynamically recognize users' photo
directories. i.e., Add users to the system without adjusting httpd.conf
for each new user?

e.g., in httpd.conf:

  # Would this work?

instead of spec'ing:





ad nauseum.

4. Does Apache::Album cache the thumbnails or does it create then anew
every time?

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Image Galleries On-the-Fly

2002-02-08 Thread Eric Pretorious

Hello, All:

I'm hoping to build a CGI script that:

1. creates a thumbnail index of .jpg files in a directory, and 
2. serves full-size images

wrapped in an HTML template, on-the-fly.

I recall a similar thread a few weeks ago on this list but have misplaced
the series of messages that transpired (and I can't find the
[EMAIL PROTECTED] arhive).

Could somebody please tell me where to find the archive?

-- 
Eric P.
Los Gatos, CA



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Most effecient way to send mail to multiple users

2002-02-02 Thread Eric Pretorious

On Fri, 1 Feb 2002, Jones, Mark wrote:
> I want my members area script to provide the capability of sending
> email to every address in the MySQL database--say 1000 addresses.  
> I'm planning to just write a loop that reads each record and sends the
> email to the address.  Or, is there a way that is more efficient for
> the server, such as outputting the emails to a text file and sending
> them in bulk somehow?

Mark:

Most Net::SMTP methods will accept a list of addresses. Make no mistake, 
however, this module is _not_ easy to use effectively. (i.e., I'm sure 
that it can be made to work easily enough, but using it to it's full 
potential is not a simple task.)

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: What modulo recomended for send emails?

2002-02-02 Thread Eric Pretorious

On Thu, 31 Jan 2002, Argenis Perez wrote:
> Hi friends
> Please What modulo recomended for send emails that i can attachment a
> file.
> Thanx

Argenis:

For sending mail with MIME attachments, I recommend MIME::Lite. There's 
even a good article on The Perl Journal describing how to use it:

  http://www.samag.com/documents/s=1289/sam04020010/

The links to the Tables, however, are broken. They should be:

  http://www.samag.com/documents/s=1289/sam04020011/
  http://www.samag.com/documents/s=1289/sam04020012/
  http://www.samag.com/documents/s=1289/sam04020013/
  http://www.samag.com/documents/s=1289/sam04020014/

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: learn java

2002-01-29 Thread Eric Pretorious

On Tue, 29 Jan 2002, william wrote:
> Where can I learn java (beginner) instead on the java.sun.com?

Probably by asking that question on a java-related mailing list.

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Module to maintain state for CGI?

2002-01-29 Thread Eric Pretorious

Bill:

Ruben Lerner ("At the Forge", Linux Journal Magazine) has written a series 
of articles about using Mason to maintain state. That's all I know on 
that subject.

On a related note: Have you considered using cookies?

-- 
Eric P.
Los Gatos, CA

On Mon, 28 Jan 2002, Daedalus wrote:

> Hi all,
> 
> I've been working on a couple of CGI programs that have
> reasonably complex menu interfaces.  I'm getting tired
> of passing state via hidden fields and urls but I don't
> want to depend on cookies.  I'm thinking the solution
> is a server side solution that creates a session ID that
> can be passed or maybe just creates a session based on
> the time/IP address.
> 
> Sounds like somthing that probably has a module already
> written ;-)   So, as I start searching through CPAN, I
> thought I'd drop a note to the list and see if someone
> could shorten my search and send me in the right
> direction.
> 
> Thanks,
> -Bill



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Modules for parsing RFC822 mail headers

2002-01-10 Thread Eric Pretorious

Hello, All:

I'd like to write a script that recieves e-mail (via the /etc/alias 
feature of sendmail/postfix) and parses the header fields. (e.g., From:, 
To:, Subject:).

I've perused the MailTools-1.42 documentation but it's way to hairy for my 
simple brain. (I haven't gotten a handle on Object-Oriented perl yet.)

I've also Mail-Field-Received-0.23 documentation but don't it hardly has 
any documentation at all..

Are there alternatives to these?

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




create a GUI via to execute perl script

2001-11-05 Thread Eric Wang

Hi guys,
 
Here's a newbie question. How do I create a GUI for users using either
UNIX (SOLARIS) or Windows to execute a perl script?
Also, I like that cool box with "browse." in with ability to browse the
system looking for files. 
 
Thank you!
 
Eric



installing CGI in IIS??

2001-11-02 Thread Eric Wang

Hi,
 
Is it possible to install CGI on IIS? I have installed perl 5.06 from
active state. But it seems that the .pl file would not get read and
renaming it to .cgi file will not work either.
Any suggestions?
Please Help
 
Thanks,
 
Eric



Re: Global Variables

2001-11-01 Thread Eric Pretorious

On Thu, 1 Nov 2001 [EMAIL PROTECTED] wrote:

> Need some help.
>  
>  I think that I need to be using global variables.  Unless Someone has a> 
> better solution.
>  
>  What I am trying to do is.  I want to set a variable for such things as  
>  
>  FONT_COLOR=00
>  BACKGROUND_COLOR=55
>  
>  For example:  So that I do not have to go through every file and set that
>  on
>  ever line that I would like to use it on.  I would like to set global
>  variable so that if I change (in this case) the colors than I only have to
>  change it in one place and be done with it.

Jason:

There are several ways to achieve this objective and most envolve HTML and 
stylesheets.

Please be more thorough about what you are trying to achieve specifically. 
i.e., "Global variables" is as vague an answer as the question that you 
are asking.

Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




SMTP: Capturing delivery status

2001-10-28 Thread Eric Pretorious

Hello:

Is there a simple way to send an e-mail and  capture the delivery status
in a perl script? I'd like to create a CGI script that will collect
visitors' e-mail addresses (from an html form) and send the visitor a
positive .html message if the greeting is successfully sent to the address
that was submitted or display an error .html page if the SMTP
transmission fails...

Net::SMTP, Mail::Sendmail, Mail::Sender, and Mail::Mailer all *seem* to
require an intermediary SMTP server. i.e., They *seem* to require that the
script hand the message off to my SMTP server for delivery. Perhaps I'm
misunderstanding, though...

-- 
Eric P.
Los Gatos, CA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




SSL via Apache on WINNT

2001-10-25 Thread Eric Wang


Hi people,

Is there a way to configure SSL for apache on winnt?
thanx

Eric


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: where to get modules? and any gui for win32?

2001-10-10 Thread Eric Wang

that version only has no nmake for winnt systems.

Thanks for the help thou

eric
On Wed, 10 Oct 2001, James Kelty wrote:

> http://www.bell-labs.com/project/nmake/
>
> -James
>
> -Original Message-----
> From: Eric Wang [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 10, 2001 2:47 PM
> To: Brett W. McCoy
> Cc: [EMAIL PROTECTED]
> Subject: Re: where to get modules? and any gui for win32?
>
>
> You know where I can get nmake? I used to have it and it works great! but
> I just lost my HD on my labtop (w/o backup) and I forgot where I got it
> from.
>
> Thanks!
> Eric
>
>
> On Wed, 10 Oct 2001, Brett W. McCoy wrote:
>
> > > Where do I get some of these cool modules like www, DBI... etc?
> >
> > www.cpan.org is the definitive repository.  Many assume the availability
> > of a C compiler and proper development tools like make or nmake.  On
> > Win32, you can use VC++, or the CygWin environment, which gives you a lot
> > of GNU tools.  ActiveState also has a repository for pre-built modules
> > (PPMs) that you can install, but it is not comprehensive like CPAN is.
> >
> > > and is there a module to write gui programs using perl in win32
> > > environmrnt? (WINNT or 2k)
> >
> > The Tk module works very well under Windows, and best of all, you can move
> > the code to another platform (Mac, Linux, Solaris) and run it with little
> > or no modification.
> >
> > -- Brett
> >   http://www.chapelperilous.net/
> > 
> > Humor in the Court:
> > Q: Now, you have investigated other murders, have you not, where there was
> >a victim?
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: where to get modules? and any gui for win32?

2001-10-10 Thread Eric Wang

You know where I can get nmake? I used to have it and it works great! but
I just lost my HD on my labtop (w/o backup) and I forgot where I got it
from.

Thanks!
Eric


On Wed, 10 Oct 2001, Brett W. McCoy wrote:

> > Where do I get some of these cool modules like www, DBI... etc?
>
> www.cpan.org is the definitive repository.  Many assume the availability
> of a C compiler and proper development tools like make or nmake.  On
> Win32, you can use VC++, or the CygWin environment, which gives you a lot
> of GNU tools.  ActiveState also has a repository for pre-built modules
> (PPMs) that you can install, but it is not comprehensive like CPAN is.
>
> > and is there a module to write gui programs using perl in win32
> > environmrnt? (WINNT or 2k)
>
> The Tk module works very well under Windows, and best of all, you can move
> the code to another platform (Mac, Linux, Solaris) and run it with little
> or no modification.
>
> -- Brett
>   http://www.chapelperilous.net/
> 
> Humor in the Court:
> Q: Now, you have investigated other murders, have you not, where there was
>a victim?
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




where to get modules? and any gui for win32?

2001-10-10 Thread Eric Wang


Hi people,

Where do I get some of these cool modules like www, DBI... etc?
and is there a module to write gui programs using perl in win32
environmrnt? (WINNT or 2k)

Thanks!

Eric


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Re: CGI on IIS <- bad idea?

2001-08-15 Thread Eric Wang


So I can actually use a CGI to carry out the perl script in the front end
and put the -T inside the cgi right? and the users cannot see which perl
script was executed because it's on the server site.
Is that right?

eric

On Wed, 15 Aug 2001, Curtis Poe wrote:

> --- Mark Bergeron <[EMAIL PROTECTED]> wrote:
> > Taint won't run on Win32 anyway.
>
> Mark,
>
> This is actually a common misconception.  Taint checking works just fine on Win32 
>using
> ActiveState Perl.  Try the following from the command line:
>
> perl -Te "$x=shift;open TEST, qq/>$x/" test.txt
>
> You will get the following error message:
>
> Insecure dependency in open while running with -T switch at -e line 1.
>
> Taint checking is problematic on Win32 systems *usually* because of the way the 
>programs are run.
> If you type "perl somescript.pl" and you have the -T switch on the shebang line, you 
>will get the
> "Too late for "-T" option at somescript.pl line 1." error.  The easiest way to get 
>around this is
> to explicitly pass the -T switch to the perl interpreter:
>
> perl -T somescript.pl
>
> If this doesn't work for you, what version of Perl are you using?
>
> Cheers,
> Curtis Poe
>
> =
> Senior Programmer
> Onsite! Technology (http://www.onsitetech.com/)
> "Ovid" on http://www.perlmonks.org/
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




CGI on IIS <- bad idea?

2001-08-14 Thread Eric Wang

Thanks! can you explain what does the taint option do?
I usually just use #!/script/perl.exe

Thanks for your help!
eric

On Tue, 14 Aug 2001, Curtis Poe wrote:

> --- Eric Wang <[EMAIL PROTECTED]> wrote:
> > Can you run CGI on IIS?
> > sorry, I always thought you either need apache or httpd for unix/linux but
> > if IIS can run CGI,it'll be great!
> >
> > eric
>
> Eric,
>
> You can run CGI on IIS, but if you run ActiveState Perl, it will set up IIS to run 
>your CGI
> scripts through ISAPI (Internet Server Application Programming Interface) instead of 
>as straight
> CGI.  ISAPI runs your Perl scripts through the perlis.dll which which has the 
>advantage of being
> persistent in memory, thus giving you faster response time, but has the disadvantage 
>of not being
> able to pass certain switches to Perl.  In particular, you can't pass the -T switch 
>and activate
> taint checking.  This is a significant security problem.  You can read more about 
>this at
> http://www.perlmonks.org/index.pl?node_id=82619.
>
> Cheers,
> Curtis Poe
>
> =
> Senior Programmer
> Onsite! Technology (http://www.onsitetech.com/)
> "Ovid" on http://www.perlmonks.org/
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Beginning CGI

2001-08-14 Thread Eric Wang

Can you run CGI on IIS?
sorry, I always thought you either need apache or httpd for unix/linux but
if IIS can run CGI,it'll be great!

eric


On Tue, 14 Aug 2001, Mark Bergeron wrote:

> Well, it would really help if you could give us an example of what you want to do (-;
>
> Mark Bergeron'
>
> -Original Message-
> From: "kahine Kldon"<[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Date: Tue Aug 14 05:39:16 PDT 2001
> Subject: Beginning CGI
>
> >Hi:
> >
> >I've just started in CGI programming. I'm actually working on an NT machine
> >and I know in order to make the cgi work in an NT machine is different than
> >in a Linux or UNIX machine.
> >Is there some tips that could help me do it.
> >
> >Thank You
> >
> >kahine
> >
> >_
> >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
> >
> >
> >--
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> /~_. _ | _ _  _  _
> \_/|(_||| | |(_)| |
>  _|
> ___
> GO.com Mail
> Get Your Free, Private E-mail at http://mail.go.com
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: problems with Guestbook script from "Official Guide ... CGI.pm"

2001-08-01 Thread Eric J. Wisti


Haven't ever used 'lock', but it is a perl function for use with
threading. I am using some of the code from the book, including the
function that you refer to. I just changed the subroutine name from 'lock'
to 'filelock'.

Eric

On Wed, 1 Aug 2001, Bertram, Paul wrote:

> Date: Wed, 1 Aug 2001 10:54:03 -0400
> From: "Bertram, Paul" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: problems with Guestbook script from "Official Guide ... CGI.pm"
>
> Folks,
>
> I have been teaching myself CGI/Perl. I have Lincoln Stein's book "Official
> Guide to Programming with CGI.pm". I have been trying to get his
> "Guestbook.pl" script to work.
>
> As a good newbie, the first thing I did was add "-w" to the shebang line and
> "use strict;". I was surprised at the number of errors generated. I've
> worked through and fixed most of them (mostly undeclared global variables),
> but am stuck on two.
>
> 1. one error says "subroutine escapeHTML redefined at line149". To my
> inexperienced eyes, it looks like that is the only place it is defined, so
> why does perl think it is being redefined?
> (line numbers are after I added the use strict; and use vars qw() lines, so
> they wont match up with the online version).
>
> 2. The second error is: Too many arguments for lock at line 102 near "1)".
> Here is sub lock:
>sub lock {
> my $path = shift;
> my $for_writing = shift;
> my ($lock_type,$path_name,$description);
>
> if ($for_writing) {
> $lock_type = LOCK_EX;
> $path_name = ">>$path";
> $description = 'writing';
> } else {
> $lock_type = LOCK_SH;
> $path_name = $path;
> $description = 'reading';
> }
>
> The call to lock() is:
> my $fh = lock($GUESTBOOKFILE,1);
>
> It looks to me like lock() requires two arguments and is supplied them by
> the call.
>
> Can someone see what I'm missing? I'm using ActiveState and Apache on a
> Win2000 machine.
>
> The whole script is online at
> http://www.wiley.com/legacy/compbooks/stein/text/guestbook.txt
> <http://www.wiley.com/legacy/compbooks/stein/text/guestbook.txt> .
>
> TIA,
> Paul Bertram, newer than most
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

 Eric Wisti
 Kinetic, Inc.
 (651) 848-0477


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]