Re: chdir to parent directory
On Fri, Jul 05, 2002 at 10:37:10AM -0400, Shishir K. Singh wrote: > >chdir (".."); > > >chdir ("\\.."); > > chdir ('..'); > chdir ('../'); > > Use single quotes. so that special characters are treated as literals. > "." and "\" are special characters. You escaped "\" but not "." .. is not a special character in this context; perhaps you're thinking of a regular expression. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Modules
Excellent. Thanks. I've been trying to install Embperl all day and my brain was too worn out to figure this out. I'm suspecting that I don't have some crucial modules installed . . . had list of dependant modules, but no easy way to discover if they are there. Thanks again! -- John # # -Original Message- # # From: Andy Lester [mailto:[EMAIL PROTECTED]] # # Sent: Saturday, July 06, 2002 12:24 AM # # To: John Almberg # # Subject: Re: Modules # # # # # # > What's an easy way to tell if a particular module is installed # # on my server? # # > I'm sure I read this somewhere, but can't find it. Thanks! # # # # Basically, try to use it: # # # # #!/usr/bin/perl # # # # use HTML::Lint; # # # # print "It must be there.\n"; # # # # The shorter, command-line way is: # # # # perl -MHTML::Lint -e1 # # # # Finally, you can try running perldoc for it: # # # # perldoc HTML::Lint # # # # or get the filename for it # # # # perldoc -l HTML::Lint # # # # The problem with this is that your module might not have docs with it, # # in which case perldoc will seem like the module's not there. :-( # # # # xoxo, # # Andy # # # # -- # # 'Andy Lester[EMAIL PROTECTED] # # Programmer/author petdance.com # # Daddy parsley.org/quinn Jk'=~/.+/s;print((split//,$&) # # [unpack'C*',"n2]3%+>\"34.'%&.'^%4+!o.'"]) # # -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Modules
What's an easy way to tell if a particular module is installed on my server? I'm sure I read this somewhere, but can't find it. Thanks! -- John -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Quick question.
On Friday, July 5, 2002, at 05:58 , Timothy Johnson wrote: > Yeah, that would work, unless you want to notify more than one person. > Then > it gets a little more complicated. Using the example you gave, it would > be > fairly easy to create a script that notified your contact. Something like > this: really close - a few typo's and some failure to focus on the POD from Net::SMTP cf: http://www.wetware.com/drieux/pbl/Other/email/useNet_SMTP.txt ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Quick question.
On Friday, July 5, 2002, at 05:27 , William Black wrote: [..] > So far All I've done is set up a hash as shown below: How can I use this > hash and any built modules to accomplish my task. In addition, if there > areany modules please include them. > > > %contact_info{ > name => 'John Smith', > title => 'Hard Worker', > email => '[EMAIL PROTECTED]', > pager => '1234567' > }; Foist - the email side of the game... you're starting to move into the correct direction - the question now is - a) if you have direct access to sendmail on your host then you can always do the standard push through sendmail eg: my $sendmail = '/usr/lib/sendmail'; my $userName = my $subject = . my $msg = open (MAIL, "| $sendmail -t -oi 2>$bailFile") or die "unable to open sendmail:$!\n"; print MAIL "To: $userName \n"; print MAIL "Subject: $subject\n\n"; print MAIL "$msg"; close MAIL or die "Failure with sendmail :$? $!\n"; b) go with the Mail::Mailer from the CPAN a basic frame work would be at: http://www.wetware.com/drieux/pbl/Other/email/useMailMailer.txt but most likely I would HIGHLY RECOMMEND: http://search.cpan.org/search?mode=dist&query=Mailtool Way Much More Better in the long run. Secondly - that 'pager' - have you thought about getting a 'webPager' server - where you just send them an email and they will page the player? Much simpler - since you can stuff it all in one email message ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Quick question.
Yeah, that would work, unless you want to notify more than one person. Then it gets a little more complicated. Using the example you gave, it would be fairly easy to create a script that notified your contact. Something like this: ### use Net::SMTP; use strict; my %contact_info{ name => 'John Smith', title => 'Hard Worker', email => '[EMAIL PROTECTED]', pager => '1234567' } my $data = ''; $data .= "To: Primary Contact"; $data .= "Subject Automated Alert\n"; $data .= "\n"; $data .= "Hello, $contact_info{name},\n"; #using the hash $data .= "This message is an automated alert to let you know that\n"; $data .= "one or more parameters are outside the acceptable range.\n"; $data .= "Please address this issue immediately.\n"; my $smtp = Net::SMTP->new('mailserver'); $smtp->mail('[EMAIL PROTECTED]'); $smtp->to($contanct_info{email}); #using the hash again $smtp->data([$data]); $smtp->quit(); Disclaimer: This may need some tweaking since I haven't actually tested it yet. -Original Message- From: William Black [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 5:38 PM To: [EMAIL PROTECTED] Subject: RE: Quick question. Thanks Timothy, Other than the module, Do I have the right idea with the hash? William >From: Timothy Johnson <[EMAIL PROTECTED]> >To: "'William Black'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE: Quick question. >Date: Fri, 5 Jul 2002 17:36:07 -0700 > > >You'll need access to an SMTP server. The first module I would recommend >is >Net::SMTP, but if you're not all that familiar with Net::SMTP, then I would >recommend going to http://search.cpan.org and doing a search on mail, smtp, >etc. > >-Original Message- >From: William Black [mailto:[EMAIL PROTECTED]] >Sent: Friday, July 05, 2002 5:28 PM >To: [EMAIL PROTECTED] >Subject: Quick question. > > >Hi All, > >I'm new to Perl and I just have a quick question. > >Within my perl pgm I'm trying to set it up so that if an error occurs an >email is sent to a certain person, page etc. > >So far All I've done is set up a hash as shown below: How can I use this >hash and any built modules to accomplish my task. In addition, if there >areany modules please include them. > > >%contact_info{ > name => 'John Smith', > title => 'Hard Worker', > email => '[EMAIL PROTECTED]', > pager => '1234567' >}; > > >Thanks, > >William Black > > >_ >MSN Photos is the easiest way to share and print your photos: >http://photos.msn.com/support/worldwide.aspx > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] William Black _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Quick question.
Modules : Net::SMTP Mail::Sender If you are using Linux like OS , and have sendmail $| = 1; open (FH, "| sendmail -t") # I forget what should be added on the above to protect /pwd/ print FH "Content"; close (FH); Rgds, Connie - Original Message - From: "William Black" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 06, 2002 8:27 AM Subject: Quick question. > Hi All, > > I'm new to Perl and I just have a quick question. > > Within my perl pgm I'm trying to set it up so that if an error occurs an > email is sent to a certain person, page etc. > > So far All I've done is set up a hash as shown below: How can I use this > hash and any built modules to accomplish my task. In addition, if there > areany modules please include them. > > > %contact_info{ > name => 'John Smith', > title => 'Hard Worker', > email => '[EMAIL PROTECTED]', > pager => '1234567' > }; > > > Thanks, > > William Black > > > _ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > 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: Quick question.
You'll need access to an SMTP server. The first module I would recommend is Net::SMTP, but if you're not all that familiar with Net::SMTP, then I would recommend going to http://search.cpan.org and doing a search on mail, smtp, etc. -Original Message- From: William Black [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 5:28 PM To: [EMAIL PROTECTED] Subject: Quick question. Hi All, I'm new to Perl and I just have a quick question. Within my perl pgm I'm trying to set it up so that if an error occurs an email is sent to a certain person, page etc. So far All I've done is set up a hash as shown below: How can I use this hash and any built modules to accomplish my task. In addition, if there areany modules please include them. %contact_info{ name => 'John Smith', title => 'Hard Worker', email => '[EMAIL PROTECTED]', pager => '1234567' }; Thanks, William Black _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- 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]
Quick question.
Hi All, I'm new to Perl and I just have a quick question. Within my perl pgm I'm trying to set it up so that if an error occurs an email is sent to a certain person, page etc. So far All I've done is set up a hash as shown below: How can I use this hash and any built modules to accomplish my task. In addition, if there areany modules please include them. %contact_info{ name => 'John Smith', title => 'Hard Worker', email => '[EMAIL PROTECTED]', pager => '1234567' }; Thanks, William Black _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cookies
O!! Right, you are definiatly right !! Thanks for correcting me.. and I am apologize to the list that I've given something wrong context... Anyway, I just try to go on it with Perl way For me, I'll use Javascript to deal with it with no doubt... Thanks for your advise anyway. Rgds, Connie - Original Message - From: "bob ackerman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 06, 2002 5:57 AM Subject: Re: cookies > > On Friday, July 5, 2002, at 02:32 PM, Connie Chan wrote: > > > Try Cookies.pm, > > $cookie_jar->accept_cookies($bool); > > document at > > http://search.cpan.org/doc/ILYAM/HTTP- > > WebTest-1.99_07/lib/HTTP/WebTest/Cooki > > es.pm > > accept_cookies($optional_accept_cookies) > Enables or disables receipt of cookies if boolean parameter > $optional_accept_cookies is passed. > > that doesn't sound like it will tell us if user has disabled cookies. if > he had disabled them, would calling this enable them? does that make sense > that you could force user to accept cookies? > > > > > - Original Message - > > From: "Mariusz" <[EMAIL PROTECTED]> > > To: "perl" <[EMAIL PROTECTED]> > > Sent: Saturday, July 06, 2002 4:13 AM > > Subject: cookies > > > > > > Is there a way to check if the person accepts cookies? > > > > thanks. > > M > > pob > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cookies
Are you checking from a web page, or do you just want to check a machine? Also, what platforms are you using? I would guess that if you're checking from a web page, then the easiest way to be sure would be to make a cookie. -Original Message- From: Mariusz [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 1:14 PM To: perl Subject: cookies Is there a way to check if the person accepts cookies? thanks. M -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cookies
On Friday, July 5, 2002, at 02:32 PM, Connie Chan wrote: > Try Cookies.pm, > $cookie_jar->accept_cookies($bool); > document at > http://search.cpan.org/doc/ILYAM/HTTP- > WebTest-1.99_07/lib/HTTP/WebTest/Cooki > es.pm accept_cookies($optional_accept_cookies) Enables or disables receipt of cookies if boolean parameter $optional_accept_cookies is passed. that doesn't sound like it will tell us if user has disabled cookies. if he had disabled them, would calling this enable them? does that make sense that you could force user to accept cookies? > > - Original Message - > From: "Mariusz" <[EMAIL PROTECTED]> > To: "perl" <[EMAIL PROTECTED]> > Sent: Saturday, July 06, 2002 4:13 AM > Subject: cookies > > > Is there a way to check if the person accepts cookies? > > thanks. > M pob
Re: cookies
Try Cookies.pm, $cookie_jar->accept_cookies($bool); document at http://search.cpan.org/doc/ILYAM/HTTP-WebTest-1.99_07/lib/HTTP/WebTest/Cooki es.pm - Original Message - From: "Mariusz" <[EMAIL PROTECTED]> To: "perl" <[EMAIL PROTECTED]> Sent: Saturday, July 06, 2002 4:13 AM Subject: cookies Is there a way to check if the person accepts cookies? thanks. M -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cookies
Is there a way to check if the person accepts cookies? thanks. M
RE: chdir to parent directory
Actually it does work. Try the following snippet of code. You will see that it prints out the files in c:/program files and then changes back to your c:/ directory. (you might want to try a smaller directory, but I wanted to choose one that I knew you had). chdir "c:/program files"; opendir(DIR,"."); print(readdir DIR); print "\n\n"; chdir ".."; opendir(DIR,"."); print(readdir DIR); -Original Message- From: T. B. Booher [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 7:27 AM To: [EMAIL PROTECTED] Subject: chdir to parent directory Hello - I am trying to use ActiveState perl on windows and I am trying to figure out how to chdir to a parent directory. I have tried the following: chdir (".."); chdir ("\\.."); but no avail. Any ideas? tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: www.roth.net; cannot find server or DNS Error
Not able to access it here... Tried via the web and ping. -- Chris Garaffa use perl; my %contact_info = (name= "Chris Garaffa", email = "[EMAIL PROTECTED]", work= "[EMAIL PROTECTED]", cell= "203.803.9066" ); He who calles himself "McCormick, Rob E" (from <[EMAIL PROTECTED]>) wrote on 7/5/02 2:10 PM: > I wanted to download a couple of roth.net modules. Unable to reach > www.roth.net since 3 July. > > Are others able to access it OK? > > Rob > -- > Rob McCormick > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
www.roth.net; cannot find server or DNS Error
I wanted to download a couple of roth.net modules. Unable to reach www.roth.net since 3 July. Are others able to access it OK? Rob -- Rob McCormick -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Check Mail then Fax [BEGGING FOR HELP.... PLEASE]
Please anybody I am begging now. Please help... This is a mess now... I even have no concept on how to start. I will working on something like this There are 2 interface as input. One is a Web interface, which will accept HTML tag and plain text by POST method, but by GET method, the input would be an URL. Another One is a mail box, like [EMAIL PROTECTED], maybe that's not really an interface, just a input channel. So, there are 3 sources will be needed to handle. GET, POST and Mail box. Then , whatever GET, POST, or Detected mail arrival, they will write into a log for waiting handle. What the meaning of handle is to FAX it out. === Problems : Q1) For Get method, How can I get the whole content of an URL ( including image and html layout ) and save it to my temp directory ? Q2) For Detecting mail arrival, I can do this. But how can I fetch those attachment data (Excel, Word) and dump to my printer driver (actually WinFax) ? Q3) How can I detect how many attachment(s) in a mail ? Because I would like to treat no attachment and attached more then 1 file as error. Q4) Refer to Q2, should I firstly split the attachemt file to a temp folder at first ? If so, how can I PICK UP the attachment from the mail ? === Any advice, module recommend, are very welcome. Thanks a lot, Connie in sick >_<''
Installing Embperl without root privilages
Has anyone tried to install Embperl without root privilages? I have used embperl on other servers, but am now trying to install it on a shared server. All I really need is embpexec.pl to work off-line. Unfortunatly, when I try to run it, I get the following error message: orange:~/src/Embperl-2.0b6$ embpexec.pl Can't find loadable object for module Embperl in @INC (/home/kemptech/src /home/kemptech/src/Embperl-2.0b6 /usr/lib/perl5/i686-linux/5.00401 /usr/lib/perl5 /usr/lib/perl5/site_perl/i686-linux /usr/lib/perl5/site_perl ..) at ./embpexec.pl line 23 BEGIN failed--compilation aborted at ./embpexec.pl line 23. As you can see, I've set up my environment so @INC includes the path to the install directory (/home/kemptech/src/Embperl-2.0b6). I can't figure out what 'loadable object' it can't find. Any ideas greatly appreciated. -- John -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lock file
At 03:08 PM 7/5/02 +1000, Toby Stuart wrote: >Hi Karen, > > >use strict; >use warnings; > >use Fcntl qw(:flock); > >open(F,"somefile.txt") || die $!; >flock(F,LOCK_EX); ># do stuff with F >flock(F,LOCK_UN); >close(F); > There seems to be a consensus to avoid LOCK_UN, although it will make no difference on newer perls. See http://groups.google.com/groups?selm=slrna444da.20q.mgjv%40verbruggen.comdyn.com.au&output=gplain -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XS and Shared Lib
On Friday, July 5, 2002, at 04:36 , BUFFERNE,VINCENT (Non-HP-France,ex1) wrote: [..] > I have done some tests with a simple "Hello World" like program and it > work > fine, but when it comes to real thing, problems arise and at run time, I > have the following error: > "Can't find 'boot_foo' symbol in foo.sl" [..] p0: make me feel all warm and fuzzy and that you started this with h2xs??? p1: hence this is occuring as part of the make test part of your testing? p2: is your XS assuming that there is a libfoo.sl in the canonical places ciao drieux --- feel free to email me back channel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: performance: pop? shift? or another way?
However, for your case, the last result would be an array like this @newArray = [1,1,1,1,1,1,1,1.]; # Seems meaningless... =) So, I guess, the final stuff you want maybe $#newArray.. If that's your case, you may also try this : my $true = 0; # you may set as -1 if you want the first count as 0 for (@array) { $true++ if $_ }; print $true If you still want it as an array style with the above method : push @newArr, 1 for (1..$count); # The number of true values in real is $#newArr + 1 Rgds, Connie - Original Message - From: "Michael Rauh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 05, 2002 3:59 PM Subject: Re: performance: pop? shift? or another way? > > thx to all, grep seems to be the best way to do it. > > greetings > michael > > -- > 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: chdir to parent directory
> "T" == T B Booher <[EMAIL PROTECTED]> writes: T> Hello - I am trying to use ActiveState perl on windows and I am trying T> to figure out how to chdir to a parent directory. I have tried the T> following: T> chdir (".."); This should work just fine. How do you know this one "didn't work"? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
performance: pop? shift? or another way?
hi, say i have an unsorted (large) list of, e.g., 0's and 1's: @list = (0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, ...) i now want to remove all the zeros, using the fastest way possible. how would U do that? i thought of sorting the zeros the left (or right) and then shift (or pop) all zeros. or perhaps to first find the offset and then do a single splice. but perhaps there's another way? performance is most important here. suggestions welcome. greetings michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CGI and Oracle Question,
Hi. Seems like something isn't installed properly: Can't locate auto/DBI/prepare.al in @INC You're missing a module or something. Not too familiar with DBI myself, so don't know which one, but checking search.cpan.org for DBI and Oracle might be helpful (?)... Best Regards Anders Holm Critical Path Technical Support Engineer -- Tel USA/Canada: 1 800 353 8437 Tel Worldwide: +1 801 736 0806 E-mail: [EMAIL PROTECTED] Internet: http://support.cp.net > -Original Message- > From: Naser Ali [mailto:[EMAIL PROTECTED]] > Sent: 05 July 2002 16:06 > To: '[EMAIL PROTECTED]' > Cc: [EMAIL PROTECTED] > Subject: RE: CGI and Oracle Question, > > > Thanks Stephen, > > I added the line as you mentioned. I am getting this error message. I > verified the TNS settings by logging into database using sqlplus as user > "www" and it worked fine. > === > DBI->connect(aali, aali, aali) failed: ORA-12154: TNS:could not resolve > service name (DBD ERROR: OCIServerAttach) at /www/cgi-bin/pl > ot5.pl line 16 > Can't locate auto/DBI/prepare.al in @INC (@INC contains: > /usr/local/lib/perl5/5.6.1/sun4-solaris > /usr/local/lib/perl5/5.6.1 /usr/loc > al/lib/perl5/site_perl/5.6.1/sun4-solaris > /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at > /www/cgi-bin/plo > t5.pl line 17 > [Fri Jul 5 10:56:52 2002] [error] [client 152.225.94.80] Premature end of > script headers: /www/cgi-bin/plot5.pl > === > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 05, 2002 10:48 AM > To: [EMAIL PROTECTED] > Subject: RE: CGI and Oracle Question, > > > try adding this to the beginning > > BEGIN { > $ENV{ORACLE_HOME} = '/opt/oracle etc'; > $ENV{ORACLE_SID} = 'SID'; > } > > Stephen Redding > > BT Ignite Solutions > Telephone - 0113 237 3312 > Fax - 0113 244 1413 > Email - [EMAIL PROTECTED] > http://www.technet.bt.com/sit/public/ > > > British Telecommunications plc > Registered office: 81 Newgate Street London EC1A 7AJ > Registered in England no. 180 > This electronic message contains information from British > Telecommunications > plc which may be privileged or confidential. The information is > intended to > be for the use of the individual(s) or entity named above. If you are not > the intended recipient be aware that any disclosure, copying, distribution > or use of the contents of this information is prohibited. If you have > received this electronic message in error, please notify us by > telephone or > email (to the numbers or address above) immediately. > > > > -Original Message- > From: Naser Ali [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 05, 2002 15:32 > To: '[EMAIL PROTECTED]' > Subject: CGI and Oracle Question, > > > Hello Everyone, > > I am trying to access Oracle database object (a table's contents) > through a > CGI script to print the information on the web page, but I am continuously > getting this error message, > > "ORACLE_HOME environment variable not set! > DBI->connect(aali) failed: Error while trying to retrieve text for error > ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4 > Can't Connect to the Database: Error while trying to retrieve > text for error > ORA-12154 (DBD ERROR: OCIServerAttach) > [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of > script headers: /www/cgi-bin/plot4.pl" > > the owner and group of CGI script and httpd is www/www, whereas oracles > user and group oracle/dba. If I run another script from command line with > same code logic and syntax just to check that user "www" I am able to > connect to database, it works fine. I am not sure what I am missing here. > Any pointers and help will be appreciated. > Regards > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Module for DNS to find MX Records ?
Thnx These modules suit me. On Thu, 2002-07-04 at 22:17, Peter Scott wrote: > At 03:40 PM 7/4/02 +1000, Toby Stuart wrote: > >http://search.cpan.org/ > > > >Net::DNS::* ??? > > > >There might be something there that does what you need. > > Indeed. From http://search.cpan.org/doc/CREIN/Net-DNS-0.23/lib/Net/DNS.pm: > > mx > > # Use a default resolver -- can't get an error string this way. > use Net::DNS; > my @mx = mx("example.com"); > > > # Use your own resolver object. > use Net::DNS; > my $res = Net::DNS::Resolver->new; > my @mx = mx($res, "example.com"); > > > Returns a list of Net::DNS::RR::MX objects representing the MX records > for the specified name; the list will be sorted by preference. Returns > an empty list if the query failed or no MX records were found. > > This method does not look up A records -- it only performs MX queries. > > >-Original Message- > >From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > >Sent: Thursday, July 04, 2002 3:32 PM > >To: [EMAIL PROTECTED] > >Subject: Module for DNS to find MX Records ? > > > > > >Hello All, > >I am working on a mailing project on LINUX and would like to know > >the Mx records of hosts from a text file in a perl program > >I know I can use programs like dig but they dont provide friendly o/ps > >There must be some module written to do dns lookups :-) > >Any pointers ? > > > >Thnx > >Ram > > -- > Peter Scott > Pacific Systems Design Technologies > http://www.perldebugged.com/ > -- Ramprasad A Padmanabhan Sr Software Engineer Netcore Solns Pvt Ltd Mumbai ph - (022) 4628000 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CGI and Oracle Question,
Thanks Stephen, I added the line as you mentioned. I am getting this error message. I verified the TNS settings by logging into database using sqlplus as user "www" and it worked fine. === DBI->connect(aali, aali, aali) failed: ORA-12154: TNS:could not resolve service name (DBD ERROR: OCIServerAttach) at /www/cgi-bin/pl ot5.pl line 16 Can't locate auto/DBI/prepare.al in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/loc al/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at /www/cgi-bin/plo t5.pl line 17 [Fri Jul 5 10:56:52 2002] [error] [client 152.225.94.80] Premature end of script headers: /www/cgi-bin/plot5.pl === -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:48 AM To: [EMAIL PROTECTED] Subject: RE: CGI and Oracle Question, try adding this to the beginning BEGIN { $ENV{ORACLE_HOME} = '/opt/oracle etc'; $ENV{ORACLE_SID} = 'SID'; } Stephen Redding BT Ignite Solutions Telephone - 0113 237 3312 Fax - 0113 244 1413 Email - [EMAIL PROTECTED] http://www.technet.bt.com/sit/public/ British Telecommunications plc Registered office: 81 Newgate Street London EC1A 7AJ Registered in England no. 180 This electronic message contains information from British Telecommunications plc which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. -Original Message- From: Naser Ali [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 15:32 To: '[EMAIL PROTECTED]' Subject: CGI and Oracle Question, Hello Everyone, I am trying to access Oracle database object (a table's contents) through a CGI script to print the information on the web page, but I am continuously getting this error message, "ORACLE_HOME environment variable not set! DBI->connect(aali) failed: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4 Can't Connect to the Database: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of script headers: /www/cgi-bin/plot4.pl" the owner and group of CGI script and httpd is www/www, whereas oracles user and group oracle/dba. If I run another script from command line with same code logic and syntax just to check that user "www" I am able to connect to database, it works fine. I am not sure what I am missing here. Any pointers and help will be appreciated. Regards
RE: CGI and Oracle Question,
I did. It is set in the .profile of user www. I dont know how to set it inside thecalling script though.? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:43 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: CGI and Oracle Question, You will need to set your $ORACLE_HOME $ORACLE_HOME = "/path/to/oracle"; -Original Message- From: Naser Ali [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 9:32 AM To: '[EMAIL PROTECTED]' Subject: CGI and Oracle Question, Hello Everyone, I am trying to access Oracle database object (a table's contents) through a CGI script to print the information on the web page, but I am continuously getting this error message, "ORACLE_HOME environment variable not set! DBI->connect(aali) failed: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4 Can't Connect to the Database: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of script headers: /www/cgi-bin/plot4.pl" the owner and group of CGI script and httpd is www/www, whereas oracles user and group oracle/dba. If I run another script from command line with same code logic and syntax just to check that user "www" I am able to connect to database, it works fine. I am not sure what I am missing here. Any pointers and help will be appreciated. Regards
Re: performance: pop? shift? or another way?
thx to all, grep seems to be the best way to do it. greetings michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: performance: pop? shift? or another way?
use strict; use warnings; my @list = qw(0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1); my @out; @out = grep($_ != 0, @list); foreach (@out){ print $_, "\n"; } -Original Message- From: Michael Rauh [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 4:40 PM To: Beginners, Perl Subject: performance: pop? shift? or another way? hi, say i have an unsorted (large) list of, e.g., 0's and 1's: @list = (0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, ...) i now want to remove all the zeros, using the fastest way possible. how would U do that? i thought of sorting the zeros the left (or right) and then shift (or pop) all zeros. or perhaps to first find the offset and then do a single splice. but perhaps there's another way? performance is most important here. suggestions welcome. greetings michael -- 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: CGI and Oracle Question,
You will need to set your $ORACLE_HOME $ORACLE_HOME = "/path/to/oracle"; -Original Message- From: Naser Ali [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 9:32 AM To: '[EMAIL PROTECTED]' Subject: CGI and Oracle Question, Hello Everyone, I am trying to access Oracle database object (a table's contents) through a CGI script to print the information on the web page, but I am continuously getting this error message, "ORACLE_HOME environment variable not set! DBI->connect(aali) failed: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4 Can't Connect to the Database: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of script headers: /www/cgi-bin/plot4.pl" the owner and group of CGI script and httpd is www/www, whereas oracles user and group oracle/dba. If I run another script from command line with same code logic and syntax just to check that user "www" I am able to connect to database, it works fine. I am not sure what I am missing here. Any pointers and help will be appreciated. Regards -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: chdir to parent directory
>Hello - I am trying to use ActiveState perl on windows and I am trying >to figure out how to chdir to a parent directory. I have tried the >following: >chdir (".."); >chdir ("\\.."); chdir ('..'); chdir ('../'); Use single quotes. so that special characters are treated as literals. "." and "\" are special characters. You escaped "\" but not "." >but no avail. Any ideas? >tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: performance: pop? shift? or another way?
Michael Rauh wrote at Fri, 05 Jul 2002 08:39:42 +0200: > hi, > > say i have an unsorted (large) list of, e.g., 0's and 1's: > > @list = (0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, ...) > > i now want to remove all the zeros, using the fastest way possible. how would U do >that? When it is so important to use to _fastest_ way, then you should take C or assembler. > > i thought of sorting the zeros the left (or right) and then shift (or pop) all >zeros. or perhaps > to first find the offset and then do a single splice. > > but perhaps there's another way? performance is most important here. suggestions >welcome. A very quick perl method is to do exactly what you had written. Remove all zeros == take everything what's not a zero and that's the exact behaviour of the grep function: my @removed_zeros_list = grep $_, @list; # Linguistic view: # the new list consists of all sensfull elements from the old list (O.K. that removes every false value from the list - if there are also '' or undefs or similar that shouldn't be removed, you need something like grep {$_ != 0}, @list;) Best Wishes, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CGI and Oracle Question,
Hello Everyone, I am trying to access Oracle database object (a table's contents) through a CGI script to print the information on the web page, but I am continuously getting this error message, "ORACLE_HOME environment variable not set! DBI->connect(aali) failed: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) at /www/cgi-bin/plo4 Can't Connect to the Database: Error while trying to retrieve text for error ORA-12154 (DBD ERROR: OCIServerAttach) [Fri Jul 5 10:17:12 2002] [error] [client 152.225.94.80] Premature end of script headers: /www/cgi-bin/plot4.pl" the owner and group of CGI script and httpd is www/www, whereas oracles user and group oracle/dba. If I run another script from command line with same code logic and syntax just to check that user "www" I am able to connect to database, it works fine. I am not sure what I am missing here. Any pointers and help will be appreciated. Regards
chdir to parent directory
Hello - I am trying to use ActiveState perl on windows and I am trying to figure out how to chdir to a parent directory. I have tried the following: chdir (".."); chdir ("\\.."); but no avail. Any ideas? tim
XS and Shared Lib
Hi, I am writting a XS wrapper between some C bits and an executable in Perl. I compile the wrapper as a Shared Lib and I want to load it dynamicaly from Perl using Dynaloader. I have done some tests with a simple "Hello World" like program and it work fine, but when it comes to real thing, problems arise and at run time, I have the following error: "Can't find 'boot_foo' symbol in foo.sl" The boot_foo function is implemented in the c file generated by xsubpp and nothing seems to be wrong with it. I have tried to export PERL_DL_DEBUG=1, but the debugger does not give more details. I am working on HP-UX, but it should not make any deference. Do you have any idea what could be wrong ? Regards, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Lock file
Hi Karen, use strict; use warnings; use Fcntl qw(:flock); open(F,"somefile.txt") || die $!; flock(F,LOCK_EX); # do stuff with F flock(F,LOCK_UN); close(F); If you're on windoze, don't expect it to work with 9x. Regards Toby -Original Message- From: Karen Liew Ying Ping [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 1:32 PM To: [EMAIL PROTECTED] Subject: Lock file Hi, is it possible to lock a file after opening it (exclusively) and prevents another person to open it? and the person can only open it after the 1st person has closed it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shopping cart 2
- Original Message - From: "Jenda Krynicky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 5:05 PM Subject: Re: Shopping cart 2 > From: "anthony" <[EMAIL PROTECTED]> > > what if the customer does NOT use cookies, i think you should make a > > file foreach custom with their IP address. and another script that > > check every now and then if the files has not been active for two > > whole hours then delete the file. > > > > Anthony > > Oh well ... bac to where we have been. > > IN this same thread someone already said that YOU CANNOT USE THE IP > ADDRESS TO IDENTIFY THE USER !!! I must have missed that post... A modified version of this IS very workable though. I have a client that does not allow cookies on his site (don't ask), and the workaround was an IP based session variable. IP.epoch.random. We ran into the dupe IP problem and solved it with the epcoh seconds followed by a random number of 1-1000. Save the session info in a file/database (your choice here), then set this, and only this, as a hidden session id in the form. This eliminates the need that a lot of stores do of passing a large amount of hidden variables back and forth (not to mention the elimination of end users hacking those parameters). > And the person has given a few examples WHY you CAN'T. > Like firewalls and proxies. > > Actually it is not a good idea not only because two users can come > from the same IP address, but also because the same user may come > from a different IP address. Like if he's connected via AOL and is > using the AOL browser. > > If you cannot use cookies (not very likely) you have to embed the > session id into the URLs. There was no need to pass it in the URL, a hidden form var works just fine... > > See http://jenda.krynicky.cz/C/SessionID.txt for a discussion on the > posibilities. > > Jenda Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]