Re: A becomes 1, B becomes 2, etc

2001-12-13 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On Dec 13, Jenda Krynicky said: > > $num = ord($char) - ord('A') + 1 > >or if you do it often > > > > my $char_base = ord('A') - 1; > > ... > > $num = ord($char) - $char_base; > No benefit to that, really. ord('A') is

Re: Can I use PERL to add/remove /etc/passwd entries

2001-12-12 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Daniel Falkenberg) wrote: > I have just finally finished a WWW based Perl program that can > add/delete and change users password from a WWW based script. I have > tried to make this script as secure as I can. The script can modify the > /etc/p

Re: Reading config file issues

2001-12-12 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Okay, this is really, really sloppy, but it's much closer in intent to what Randal >was talking > about (only relevant code is presented): > sub doConf > { > my ($conf, $directives, $config_data) = @_; > while (($directive, $co

Re: HTML::Parser

2001-12-12 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Walter Valenti) wrote: > Hi, i'm looking for some SIMPLE examples of HTML::Parser module. > > I'm find some examples but are complex. look at some of its subclasses, like HTML::LinkExtor. Gisle has also posted some examples on comp.lang.per

Re: Confirmation...

2001-12-07 Thread _brian_d_foy
In article <01ad01c17ee7$dcbfff80$5960a9cb@nothing>, [EMAIL PROTECTED] (Leon) wrote: > This /([\d.]*)\/.*/g works irregardless whether your ip is 206.48.16.3/12345 > or src=206.48.16.3/12345 it doesn't work at all, actually. -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta

Re: Confirmation...

2001-12-06 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jean-Francois Messier) wrote: > I'm a beginner in those regular expressions and s/// operations. How > can I extract only the digits and the periods (.) from a string ? I have > something like 206.48.16.3/12345. An IP address with a port

Re: perl script to remove control M's

2001-12-06 Thread _brian_d_foy
In article , [EMAIL PROTECTED] (Brent Michalski) wrote: > I always like to simply use: > > perl -pi -e 's/\r//' you have to be careful with that though because it's not portable. \r means different things to different OSes :) perl -pi -e 's/\

Re: mysql....postgres

2001-12-06 Thread _brian_d_foy
In article <000801c17e49$4a172df0$[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Nafiseh Saberi) wrote: > why do you use always "mysql" and > not "postgres" ?? who said nobody uses postgresql? -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.ht

Re: recommended perl training in UK?

2001-11-19 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randal L. Schwartz) wrote: > > "Chris" == Chris Ball <[EMAIL PROTECTED]> writes: > Chris> [1]: http://www.stonehenge.com/ being the most obvious example. > Both Tom Phoenix and I have been to London. I'd be very happy to go > back, and ma

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randal L. Schwartz) wrote: > > "Christopher" == Christopher Solomon <[EMAIL PROTECTED]> writes: > Christopher> But you must get to meet so many great people! > I do, for a few hours at a time. It's hard to do more than get an > interest i

Re: Perl file creation

2001-10-30 Thread _brian_d_foy
In article <007101c1617a$9fd47590$58644c18@windomain>, [EMAIL PROTECTED] (Scott Lutz) wrote: > I have a Perl script that is creating files. The only problem is that > they are being created with the wrong username:group. Any idea as to > why this is happening, and an easy way to fix it? do yo

Re: STDERR question.

2001-10-30 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Peter Lemus) wrote: > I would like to send all errors and messages to a > file, but also to the screen when the script execute. you need IO::Tee http://search.cpan.org/search?dist=IO-Tee -- brian d foy <[EMAIL PROTECTED]> - Perl services for

Re: Not loading CGI totally

2001-10-29 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Etienne Marcotte) wrote: > I am using CGI only to get the data sent to the script from my html > forms. > > each variable is stored in a variable $IN::variablename > > When I put use CGI, does it "load" all the module?? you might want to look

Re: Need help with CGI module

2001-10-28 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Dave Turner) wrote: > I have scanned the docs and can't seem to find the answer to this anywhere. > > I want to change the color of the text and the font size on a web page > using CGI:pm. > but I'd like to have the flexibility to do you ca

Re: How do I get username in Perl ?

2001-10-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > use > $user_name = $ENV{'AUTH_USER'}; # for name of the user > and > $user_psw = $ENV{'AUTH_PASSWORD'}; # for password i suppose that might work somewhere, but not in anything i've ever seen. if you are talking about CGI, you're usin

Re: how to match pattern at initial line

2001-10-21 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > if I have these lines: > --- > AAA BBB CCC > BBB CCC AAA > CCC AAA BBB > --- > > How to matching BBB at line 2 (BBB at the beginning of the line) > but not matching line 1 and 3. ' /^BBB/ ' is not work. use the m (for multiline) flag:

Re: HTML::Parser

2001-10-21 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Sunthari) wrote: > How do I use HTML::Parser to visit each urls.I need to > extract some lines in each pages. to extract URLs use HTML::SimpleLinkExtor :) -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - http://www.pe

Re: accessing environment variables

2001-10-19 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Greg Froese) wrote: > I want to be able to test whether I'm in Windows or Linux, and this seems > like a good way to do it. you want $^O, not an environment variable. take a look inside CGI.pm for some example code. :) -- brian d foy <[EMAI

Re: array of arrays

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Michael Fowler) wrote: > $array[$i][$j][$k][$l][$m] eq $list[$l][$m] > However, this is the first time I've seen someone intentionally using such a > large-dimension array. What is this for? i've used many more dimensions than that ;) -- bri

Re: Fraction to integer.

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Amit Joshi) wrote: > Is there a way in perl to directly convert a fractional number to > its nearest integer value ?? use the int() function. http://www.perldoc.com/perl5.6.1/pod/func/int.html -- brian d foy <[EMAIL PROTECTED]> - Perl ser

Re: "BETWEEN" Comparison Operator

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Mark Martin) wrote: > I can only seem to do this with 2 conditional statements(IF & ELSIF) and > the action repeated. What I want is a "Between" operator for the range -10 > to 10. > Any ideas, Perl 6 will have this. patience :) -- brian d f

Re: Factory method

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > http://www.perfascist.com/factory.tar.gz couldn't find this domain *shrug* > The List class is nothing but a placeholder for its subclasses. When it's > constructor method (sub new) is called, it creates an instance of one of its > s

Re: Data Structures

2001-10-03 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (David Gilden) wrote: > Here are my two questions, first is there a cleaner way of dealing > the 'radio button group' next is the building of a hash of hashs, and > I can not seem to sort desired criteria. As a PERL neophyte all help > is app

Re: Connecting to an Access/MySQL database

2001-10-03 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Greg Froese) wrote: > what module(s) would I need to connect to an access database? use the DBI module. http://search.cpan.org/search?dist=DBI perhaps with an ODBC driver http://search.cpan.org/search?dist=DBD-ODBC > and if I code a

Re: extraction

2001-10-02 Thread _brian_d_foy
In article <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>, COLLINEAU wrote: > The finding lines are like that: "gqgfqsgdkg< a > href="rdn?oiddsfhlhfdsrub=lhfdlhg" class sljdfsgkjfd" > I only want to extract the underlined string. How can i do to stop the > extraction at "class" ? i don't see any un

Re: CGI script to change user's password.

2001-10-02 Thread _brian_d_foy
In article <006301c14b33$25b5c7d0$9f01a8c0@Jaya>, [EMAIL PROTECTED] (Rajeev Rumale) wrote: > I am sure there would be some read packages to do all user management tasks. > May be Gurus can put for light on the subject. just search CPAN for HTTPD::UserAdmin. http://search.cpan.org/search?di

Re: matching

2001-10-02 Thread _brian_d_foy
In article <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>, COLLINEAU wrote: > The matching doesn't work ! want to match for example : > http://www.01net.com/rdn?oid=54682&rub=12456 use HTML::SimpleLinkExtor http://search.cpan.org/search?dist=HTML-SimpleLinkExtor -- brian d foy <[EMAIL PROTECTE

Re: dot-named sub

2001-10-02 Thread _brian_d_foy
In article <00a201c14b46$2d177330$9f01a8c0@Jaya>, [EMAIL PROTECTED] (Rajeev Rumale) wrote: > Well only "_brian_d_foy <[EMAIL PROTECTED]>" can answer that , as he/she has > posted the question. i posted the answer, not the question. :) -- brian d foy <[EMAIL

Re: dot-named sub

2001-10-02 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jos? Luis Sancho) wrote: > I am in need of a tip to name a sub with a '.' (dot) as > > sub www.com { > bla, bla > } you can't use a full stop. use an underscore instead. sub www_com { } -- brian d foy <[EMAIL PROTECTED]> - Perl ser

Re: Comparing two arrays in longest element order

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randal L. Schwartz) wrote: > > "brian" == brian d foy <[EMAIL PROTECTED]> writes: > brian> In article <[EMAIL PROTECTED]>, > brian> [EMAIL PROTECTED] (Darin Weeks) wrote: > brian> you can use a schwartzian transform to pre-compute the len

Re: Comparing two arrays in longest element order

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Darin Weeks) wrote: > I am trying to compare two arrays for a macro building system. I need to > start with the longest longest element from array 1 (the macros) and then > compare it to all elements in array 2. > Is there a simple way to cycl

Re: global variables

2001-09-24 Thread _brian_d_foy
In article <001201c144fb$4a1ba3d0$ec00a8c0@boxx>, [EMAIL PROTECTED] (Sascha Kersken) wrote: > Perl 5.6 provides the 'our' statement as opposite to 'my': it makes a > variable global to a file in which it's used. it declares a package variable, actually. if you aren't in its package, then you h

Re: global variables

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Ruth Albocher) wrote: > I would like to use a global variable in my perl application, but since > everything in perl is in a package, it will always belong to some > package. what can I do? stay away from global variables. :) what are you tryi

Re: How many elements are there in a hash?

2001-09-24 Thread _brian_d_foy
In article <2FB59B145095D511A7C90050BAC349F312DB@MAIL>, [EMAIL PROTECTED] (John Edwards) wrote: > $hash_length = scalar keys %hash; that's already in scalar context since you are assigning to a scalar. :) -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - http://www.per

Re: Help

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED] m>, [EMAIL PROTECTED] (Ronald Yacketta) wrote: > my $output = < Select the number of clients to run for this SLT: > 1) 2000 > 2) 1500 > 3) 1300 > 4) 500 > => > EOF > ; > print $output; > $num_clients = ; > how w

Re: going down an uncharted path

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED] m>, [EMAIL PROTECTED] (Ronald Yacketta) wrote: > Could someone point me to some examples? please, dont send the usual perldoc > -f blah.. the company I am doing these scripts for does not have the perldoc > installed there is always a way to get the perl d

Re: Inserting into the middle of arrays

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Walter Valenti) wrote: [original citation missing] > > How do I insert $scalar into position $x of @array, where $x is smaller than > > $#array? > $array[$x]=$scalar; this replaces whatever was at index $x. to insert something you need to us

Re: How many elements are there in a hash?

2001-09-24 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (George S Pereira) wrote: > I need to find out the number of elements in the hash. > > Is there any quick way, like $#array for arrays. the keys() function, in scalar context, returns the number of pairs in the hash. http://www.perldoc.co

Re: hello

2001-09-24 Thread _brian_d_foy
In article <013e01c144d5$38c6f3d0$73f88a10@kavitham>, [EMAIL PROTECTED] (Kavitha Malar) wrote: > I want to take a win32 perl script to unix. Is their any document > telling that what are the problems we are going to face, when we take > the script to unix domain. the perlport man page is prob

Re: System call to print to webpage

2001-09-23 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (David Freeman) wrote: > $uptime = system ("/usr/bin/uptime"); you want to save the output, so use backticks. my $uptime = `/usr/bin/uptime`; -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - http://www.perl.org/CG

Re: bless function

2001-09-17 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Baby Lakshmi) wrote: > I really dont understand the functionality and advantages of using bless. bless() "tags" a reference with a package name, effectively turning it into an object. without bless you don't have objects. http://www.perld

Re: grep utility

2001-09-14 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John_kennedy) wrote: > Is this line correct: > @UNLOCKED = grep(!/LOCKED/g, @SAME); you could just as well say @UNLOCKED = grep( !/LOCKED/, @SAME); since you only need to find the string once. > print BOTH @SAME; > print oBOTH @UNLOCKED

Re: Sending a user id and password

2001-09-13 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > It's not terribly well-known, but there is an alternative method of > using Basic Authentication. > You should be able to authenticate with the following syntax: > http://Ovid:[EMAIL PROTECTED]/cgi-bin/ascript.cgi this isn't

Re: to remove the file extension

2001-09-13 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jaya Kumaran) wrote: > In a directory there exist *.c and *.out files. Here *.out is > created for every *.c file. I need to check whether .out is > generated for all the .c file. How to achive this. you can do something like so. rem