Re[2]: Code clean up help ---- PLEASE

2002-01-11 Thread Maxim Berlin
Hello Ronald, Friday, January 11, 2002, Yacketta, Ronald <[EMAIL PROTECTED]> wrote: YR> No takers on my minor request for help from the guru's? don't know about gurus, but i feel something very strange about your code. please show rest of your code and tell, what this code should do for you. i'

Re: AdminMisc::GetHostName Question

2002-01-04 Thread Maxim Berlin
Hello Dean, Saturday, January 05, 2002, Dean Theophilou <[EMAIL PROTECTED]> wrote: DT> Can someone tell me if the GetHostName function is a reliable way of DT> determining if a particular machine is up or down? Thanks. no. gethostname/gethostbyname deals with only one computer - DNS ser

Re: REGEXP Help on Linux

2002-01-04 Thread Maxim Berlin
Hello Daryl, Saturday, January 05, 2002, Daryl J. Hoyt <[EMAIL PROTECTED]> wrote: DJH> Hi, DJH> I am trying to use the net::telnet module, and I keep timing out. I DJH> believe it is because I do not have the right prompt. My prompt looks like DJH> [sqa1@duke:~]$. I do not know why this d

Re[2]: Computer connected to the internet?

2002-01-04 Thread Maxim Berlin
Hello Gary, Friday, January 04, 2002, Gary Hawkins <[EMAIL PROTECTED]> wrote: >> GH> How can I check whether the system is connected? >> your OS? and your connection type? GH> Well, everything in the world preferably (I'm only asking for the world), if GH> others are going to be able to run it

Re: UUCP and perl (or any alternatives)

2002-01-04 Thread Maxim Berlin
Hello Dermot, Friday, January 04, 2002, Dermot Paikkos <[EMAIL PROTECTED]> wrote: DP> Hi Gurus, DP> I need to create a script to copy files from one server to another. DP> Both servers are UNIX (Tru64). My 1st thought was to use a system DP> to uucp to the other server but this is proving prob

Re: Computer connected to the internet?

2002-01-04 Thread Maxim Berlin
Hello Gary, Friday, January 04, 2002, Gary Hawkins <[EMAIL PROTECTED]> wrote: GH> How can I check whether the system is connected? GH> Want to pause the script if connection is lost. your OS? and your connection type? Best wishes, Maximmailto:[EMAIL PROTECTED]

Re[2]: Best perl on windows?

2002-01-04 Thread Maxim Berlin
Hello Gary, Friday, January 04, 2002, Gary Hawkins <[EMAIL PROTECTED]> wrote: GH> So then the only differences that come to mind are (1) paths (below), and (2) GH> you only need #! in the first line, although you need "perl" there to use -w. GH> It can be #!/usr/local/bin/perl -w and that works.

Re[2]: add text to the end of a word. HELP!!

2002-01-01 Thread Maxim Berlin
Hello Leon, Tuesday, January 01, 2002, Leon <[EMAIL PROTECTED]> wrote: >> Can you open a file for reading and writing as the same time? yes. L> I have asked the question of can I read and write to the same file L> simultaneously, such as this :- L> open FILE, 'myfile.txt' or die "$!\n"; L> open

Re: Making Cygwin and Apache and Perl Play Nice

2001-12-31 Thread Maxim Berlin
Hello Richard, Monday, December 31, 2001, Richard S. Crawford <[EMAIL PROTECTED]> wrote: RSC> Here's the problem. When I run Perl scripts under win2k, I have to include RSC> this as the first line of each CGI script: RSC> #! c:/perl/bin/Perl.exe RSC> But when I run them under Linux,

Re: help with DBD error

2001-12-20 Thread Maxim Berlin
Hello JIM-CONT, Thursday, December 20, 2001, FLAHERTY, JIM-CONT <[EMAIL PROTECTED]> wrote: FJC> hello, I have redhat 7.1 and perl is loaded with mysql , I have several FJC> scripts with perl , DBI, DBD and mysql working fine , so If think I have FJC> everything set up properly FJC> But I get

Re[2]: Data through the parallel port

2001-12-20 Thread Maxim Berlin
Hello Stanislav, Thursday, December 20, 2001, Stanislav Zahariev <[EMAIL PROTECTED]> wrote: >> hi. >> in last month , i send data through port but not with laser. >> i am working in ISP and send and receive data through port >> and routhr. SZ> So, how ? :)) With perl or without? I can manage it

Re: client-server communication

2001-12-14 Thread Maxim Berlin
Hello Michael, Wednesday, December 12, 2001, Michael McQuarrie <[EMAIL PROTECTED]> wrote: MM> I am trying to get a client to communicate with a server located MM> on another host. I can get the 2 to connect, the server to send MM> data, and the client to receive the data on the other end

Re: calling a server via http

2001-12-08 Thread Maxim Berlin
Hello rory, Saturday, December 08, 2001, rory o'connor <[EMAIL PROTECTED]> wrote: roc> I'm not sure if perl is best suited for this project - but I bet it is! I roc> need to call a server (perhaps via lynx?) in a cron'd script and then time roc> how long it takes for the page to load. roc>

Re: shifting scalars ??

2001-12-08 Thread Maxim Berlin
Hello Craig, Saturday, December 08, 2001, Craig Inman <[EMAIL PROTECTED]> wrote: CI> As I'm new to perl, I'm more or less trying to write a 'nested while CI> read' loop (atleast that is what my attempts come out to look like so CI> far). CI> trying something like CI> open (A, $list1) or di

Re: PERL MySQL DBI

2001-12-06 Thread Maxim Berlin
Hello Aaron, Friday, December 07, 2001, Aaron Shurts <[EMAIL PROTECTED]> wrote: AS> Okay, I was the one that asked the crazy question about the weird join, AS> but I got that figured out. Now I have a problem. AS> while( ($login, $existingemail, $areacode, $prefix, $rest) = $sth->>fetchrow_arr

Re[4]: "q" as an argument

2001-12-05 Thread Maxim Berlin
Hello Michael, Wednesday, December 05, 2001, Michael McQuarrie <[EMAIL PROTECTED]> wrote: MM> Maxim, MM> Correction: MM> The "use strict;" requires the arguments to all be quoted. yes. MM> In the real script I am only using "use strict 'vars';". This way MM> I can keep the syntax of calling t

Re: Loop

2001-12-05 Thread Maxim Berlin
Hello Purshottam, Wednesday, December 05, 2001, Purshottam Chandak <[EMAIL PROTECTED]> wrote: PC> i was trying to work it out, for any kind of array. PC> the following pseudo code doesn't seem to work PC> for(.) { PC> if(...) { PC> .. PC> } PC> else { PC> PC> break; PC> } P

Re: "q" as an argument

2001-12-05 Thread Maxim Berlin
Hello Michael, Wednesday, December 05, 2001, Michael McQuarrie <[EMAIL PROTECTED]> wrote: MM> I am defining a sub that takes only specific options: MM> sub error_notify MM> { MM> my $ERR_USAGE = "error_notify (e,p,x, \"Message Text\")\n"; MM> foreach (@_) MM> { MM> if(/^e$/) {

Re: Pattern match woos

2001-12-05 Thread Maxim Berlin
Hello Dermot, Wednesday, December 05, 2001, Dermot Paikkos <[EMAIL PROTECTED]> wrote: DP> Hi there, DP> This is both frustrating and embarrassing. I can't capture the DP> following data into a variable. The line I want is: DP> GIAZUC00 DP> I have tried a multitude of Regex, none seems to be w

Re[2]: Simpler....

2001-12-05 Thread Maxim Berlin
Hello Sandeep, Wednesday, December 05, 2001, Shinagare, Sandeep <[EMAIL PROTECTED]> wrote: SS> Hi All, SS> I am trying to learn Perl and want to begin with getting an interpreter for SS> the Windows OS (NT). SS> Which are the good ones around for download? http://www.perl.com/pub/a/language/inf

Re: Does Perl have an equivalent of C's #include

2001-12-05 Thread Maxim Berlin
Hello Andrew, Wednesday, December 05, 2001, Andrew Clark <[EMAIL PROTECTED]> wrote: AC> The subject says it all. AC> R, AC> AJFC AC> Please CC replys, I'm not on the list. perldoc -f require perldoc -f use Best wishes, Maximmailto:[EMAIL PROTECTED] -- To uns

Re: Simpler....

2001-12-05 Thread Maxim Berlin
Hello Daniel, Wednesday, December 05, 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote: DF> Please don't stree to much over this one but, is there an easier way of DF> writing this? DF> while(1){ DF> if ($status == 1) { DF> #Do this sub... DF> sub(); DF> elsif ($status == 1) { DF>

Re[4]: What's wrong with unlink?

2001-12-04 Thread Maxim Berlin
Hello Tirthankar, Tuesday, December 04, 2001, Tirthankar C. Patnaik <[EMAIL PROTECTED]> wrote: TCP> Hi Maxim, >> no :) you forgot to escape backslash. but there is no difference >> between \ and / slashes in path names in perl for windows. >> TCP> Thanks for this. I use perl on a Linux box, a

Re[2]: UID's

2001-12-04 Thread Maxim Berlin
Hello Christo, Tuesday, December 04, 2001, Christo Rademeyer <[EMAIL PROTECTED]> wrote: CR> Thanks CR> got mine like this. CR> open (TFH," @data = ; CR> foreach $line(@data) { CR> ($user,$pass,$uid,$gid,$info,$home,$type) = split /:/, $line; CR> } CR> $a = ($uid + 1); CR> bit shitty i

Re[2]: problem executing linux command in perl

2001-12-04 Thread Maxim Berlin
Hello Rahul, Tuesday, December 04, 2001, Rahul Garg <[EMAIL PROTECTED]> wrote: RG> Also, the script is working fine if i am changing permissions manually .it RG> is fetching and appending data to $r_file RG> Any suggestions.. 'no such file or directory' means, that your $r_file does not exists.

Re: UID's

2001-12-04 Thread Maxim Berlin
Hello Christo, Tuesday, December 04, 2001, Christo Rademeyer <[EMAIL PROTECTED]> wrote: CR> Hi how can I do this in perl ? srdof the same thing? CR> tail -n5 /etc/passwd | cut -d: -f3 CR> <- = ->> CR> 23 CR> 77 CR> 100 CR> 501 CR> 501 for example, you can write my @uids=`tail -n5 /etc/passwd |

Re[2]: Can Perl work like Expect?

2001-12-04 Thread Maxim Berlin
mode=module&query=sftp AM> By the way, Are these modules installed by default on the Perl AM> distributions? by default - no. AM> Or, how can I tell if a module is installed or not? something like perl -e "use Net::FTP;" if module is not installed, you'll recie

Re[2]: create an NT user with Perl

2001-12-04 Thread Maxim Berlin
Hello Jorge, Tuesday, December 04, 2001, Jorge Goncalvez <[EMAIL PROTECTED]> wrote: JG> HI, I wonder if there is a way to create an NT user with Perl? take a look at net.exe program. try net help net help user Best wishes, Maximmailto:[EMAIL PROTECTED] -- To un

Re[2]: What's wrong with unlink?

2001-12-04 Thread Maxim Berlin
Hello Tirthankar, Tuesday, December 04, 2001, Tirthankar C. Patnaik <[EMAIL PROTECTED]> wrote: TCP> You might want to check the permissions of those files. TCP> The command works fine here. TCP> But I guess the mistake is that you're working on Windows, and there you have TCP> a back-slash (

Re[2]: Can Perl work like Expect?

2001-12-04 Thread Maxim Berlin
Hello Ahmed, Tuesday, December 04, 2001, Ahmed Moustafa <[EMAIL PROTECTED]> wrote: AM> Thanks a lot. Where can I find exmaples for using Expect.pm, please? http://search.cpan.org/search?mode=module&query=expect but, for telnet and ftp you can use Net::Telnet and Net::FTP modules. http://search.

Re[2]: a beginners challenge

2001-11-30 Thread Maxim Berlin
Hello Shawn, Friday, November 30, 2001, Shawn <[EMAIL PROTECTED]> wrote: >> @result= `find . -newerct \'3 days ago\' -maxdepth 1 -exec rm \{\} \\;`; S> I guess I have to ask, what is this command? -newerct? I get the following S> when running this line: S> find: -newerct: unknown option

Re: perl and html tables?

2001-11-30 Thread Maxim Berlin
Hello Craig, Friday, November 30, 2001, Craig Sharp <[EMAIL PROTECTED]> wrote: CS> I need to create a script that will use DBI to retreive CS> information from Informix and then present the information in a CS> table in html. CS> The DBI part I have with no problem. CS> I need

Re: a beginners challenge

2001-11-30 Thread Maxim Berlin
Hello Roiy, Friday, November 30, 2001, Zysman, Roiy <[EMAIL PROTECTED]> wrote: >> Hi All, >> Why not make a little challenge .. >> Lets see who can write the most lean ,mean , elegant , powerful, poetic >> (but most important) _Shortest_, script that cleans from a directory >> files that are at

Re: Fork ??

2001-11-30 Thread Maxim Berlin
Hello Randy5235, Friday, November 30, 2001, Randy5235 <[EMAIL PROTECTED]> wrote: R> Pretty new to Perl still so forgive me a bit please. I have searched the web R> (google is my friend) and searched the groups and found multiple things R> concerning fork. here is the problem I can't find a page

Re: CPAN usage

2001-11-30 Thread Maxim Berlin
Hello Martin, Friday, November 30, 2001, Martin Pfeffer <[EMAIL PROTECTED]> wrote: MP> 1. I has no internet connection at home and so i want to make a local MP> copy of cpan Modules on my Fileserver. Where or why can i download MP> this? take a look at http://www.cpan.org/misc/cpan-faq.html#How

Re: shadow file

2001-11-22 Thread Maxim Berlin
Hello nafiseh, Thursday, November 22, 2001, nafiseh saberi <[EMAIL PROTECTED]> wrote: ns> hi. ns> I find one source code about crypt function. ns> I put it in my source code,but ns> it gives this error to me : ns> " useradd: unable to lock password file ". ns> i want to add user from web

Re: REGEX or Parse a text file

2001-11-14 Thread Maxim Berlin
Hello Dermot, Wednesday, November 14, 2001, Dermot Paikkos <[EMAIL PROTECTED]> wrote: DP> I am having trouble getting the data I want out of a text file: The file has DP> this sturcture: DP> File Name: m:\a\a084099.jpg DP> Width x Height: 2480 x 2062 DP> Number of Colours: True Colour (24 b

Re: HELP - I am trying to connect to a MySql database

2001-11-14 Thread Maxim Berlin
Hello A, Wednesday, November 14, 2001, A Taylor <[EMAIL PROTECTED]> wrote: AT> I am tring to connect to a MySql database and I have been told that I have AT> to include the 'HOSTNAME' (localhost). Can anyone see anything wrong with AT> this code ?? AT> use DBI; AT> my $database= 'myd

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

2001-11-09 Thread Maxim Berlin
Hello, looks like i'm only one from Russia (Moscow) here... Best wishes, Maximmailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re[2]: [Socket] Question

2001-11-09 Thread Maxim Berlin
Hello RArul, Friday, November 09, 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Rnc> Thanks John. The purpose was not to send email. I was just trying to see if Rnc> I am able to do a conversation with some server using a socket, as I am just Rnc> learning to program a socket. well, try to

Re[2]: merging two hashes together?

2001-11-03 Thread Maxim Berlin
Hello Wagner-David, Saturday, November 03, 2001, Wagner-David <[EMAIL PROTECTED]> wrote: WD> Here is one shot, though I changed some of the constants: WD> #!perl -w my %h1 = ("one" => 1, "two" => 2, "three" => 3); my %h2 = ("four" => 4, "five" => 5, "six" => 6); WD> my %h3 = (); WD

Re: Reference's ?

2001-11-03 Thread Maxim Berlin
Hello JUAN, Saturday, November 03, 2001, AMORE,JUAN (HP-Roseville,ex1) <[EMAIL PROTECTED]> wrote: AJHRe> I'm new to creating references. AJHRe> How do I create a small script that replaces "C" with "D" using a reference AJHRe> only to the array element location for AJHRe> "C"? AJHRe> #!/usr/bi

Re: terminating input

2001-11-02 Thread Maxim Berlin
Hello Jason, Saturday, November 03, 2001, Jason Cruces <[EMAIL PROTECTED]> wrote: JC> Hello all, JC> Probably are really simple one but haven't found the JC> answer yet. In an interactive program, where a user is JC> prompted to enter more than one value, I would use JC> chomp(@values = ); JC>

Re[2]: gethostbyname and getnetbyname

2001-11-02 Thread Maxim Berlin
Hello Nathaniel, Saturday, November 03, 2001, Wert, Nathaniel <[EMAIL PROTECTED]> wrote: WN> Maybe it comes in the statement before that: WN> $nodename = ; :) you forgot chomp $nodename; here. $nodename contains '\n' at the end. WN> $iaddr = gethostbyname($nodename); WN> ($a,$b,$c,$d) = unpack

Re: gethostbyname and getnetbyname

2001-11-02 Thread Maxim Berlin
Hello Nathaniel, Friday, November 02, 2001, Wert, Nathaniel <[EMAIL PROTECTED]> wrote: WN> 1) I can get gethostbyname to work in this format: WN> gethostbyname('node.foo.com'). I need it to work in the following WN> format: gethostbyname($nodename). Is this not set up for that?

Re[2]: Outputting shell command to a browser

2001-11-02 Thread Maxim Berlin
Hello Robert, Friday, November 02, 2001, Robert Thompson <[EMAIL PROTECTED]> wrote: RT> The overall problem is not if grep works or not, but why the RT> output from the backticks does not show up in the cgi. I only put RT> the grep in there to make the code read easier. $results does not

Re: STDERR

2001-10-27 Thread Maxim Berlin
Hello Walter, Saturday, October 27, 2001, Walter Grace <[EMAIL PROTECTED]> wrote: WG> I have a script that is called from the web that has 'warn' statements WG> embedded. WG> Regarding the 'warn' statements: Where does STDERR output get sent by default? WG> How can I redirect it to a specif

Re: please help with fork

2001-10-27 Thread Maxim Berlin
Hello Maxim, Saturday, October 27, 2001, Maxim Goncharov <[EMAIL PROTECTED]> wrote: MG> I need help with understanding what is happening when I fork a MG> process.Here is actual code: you did not 'fork' process. 'fork' is very special function, see perldoc -f fork man fork for nore information.

Re: wats wrong?

2001-10-27 Thread Maxim Berlin
Hello pApA_rOACh, Saturday, October 27, 2001, pApA_rOACh <[EMAIL PROTECTED]> wrote: p> Hear is string that should work, at least i think so. p> last if m/^\s*model\s*tiny.*/i while (<>); p> Can anybody say what's wrong. p> while <>; - Valid perl construction hence p> last if m/^\s*model\s*tin

Re: Net::Telnet

2001-10-27 Thread Maxim Berlin
Hello Joe, Saturday, October 27, 2001, Joe Echavarria <[EMAIL PROTECTED]> wrote: [..] JE> I think there is something missig or wrong on my JE> script. Please let me know. JE> The script should accept input from the command JE> line. JE> The script is below : JE> ### JE> #!/usr/

Re: problem with 'use strict'

2001-10-26 Thread Maxim Berlin
Hello David, Saturday, October 27, 2001, David Gilden <[EMAIL PROTECTED]> wrote: DG> As an exercise I have two files, a library file and a main DG> file. If I try to 'use strict' my script won't run. DG> What do I have to change so that things will work correctly with DG> out clobbering any of

Re: Search and replace using a variable

2001-09-13 Thread Maxim Berlin
Hello Jimson, Thursday, September 13, 2001, Jimson Lee <[EMAIL PROTECTED]> wrote: [..] JL> Being new to perl, I know how to search for strings. I know how to JL> explicitly search and replace a string. you always can use variable instead of exact string. JL> What I don't know how to do is JL

Re: "system" command failure

2001-09-12 Thread Maxim Berlin
Hello Tyler, Thursday, September 13, 2001, Tyler Cruickshank <[EMAIL PROTECTED]> wrote: TC> Hello. I am trying to use the system command to run a FORTRAN TC> program on my Solaris 5.7 system. In the code pasted below the TC> following system call: TC> system("chmod 777 /trinidad/uama

Re[2]: line end problems - help #2

2001-09-12 Thread Maxim Berlin
Hello Curtis, Thursday, September 13, 2001, Curtis Poe <[EMAIL PROTECTED]> wrote: CP> That will show non-printing characters (-v) and the end of line will be indicated with a dollar CP> sign (-E). If you see a ^M before the end of line, you have saved the file in DOS mode. To fix CP> it, use

Re[2]: line end problems - help #2

2001-09-12 Thread Maxim Berlin
Hello Ron, Thursday, September 13, 2001, Ron Woodall <[EMAIL PROTECTED]> wrote: >>If you use FTP to transfer file between windows and linux, switch your >>ftp client to 'ascii' mode. >>If not, tell your editor to save output file in unix format. RW> I store the file directly to the Lin

Re: line end problems - help #2

2001-09-12 Thread Maxim Berlin
Hello Ron, Wednesday, September 12, 2001, Ron Woodall <[EMAIL PROTECTED]> wrote: RW> I asked a similar question before and got no response. I guess I didn't RW> explain myself. RW> Here's the problem. I'm using a perl script to create an html page. The RW> editor is located on a

Re: '' and ""

2001-09-12 Thread Maxim Berlin
Hello Matija, Tuesday, September 11, 2001, Matija Papec <[EMAIL PROTECTED]> wrote: MP> Is there a reason why '' should be preferred over "" when using static MP> expressions? My guess is that "" takes a little longer at compile time for at run time. inside loop, for example. MP> perl to see if

Re: timestr (benhcmark)

2001-09-10 Thread Maxim Berlin
Hello Ronald, Monday, September 10, 2001, Yacketta, Ronald <[EMAIL PROTECTED]> wrote: YR> I have the following benchmark line in my perl code YR> my $etime = timeit(1, \&get_errors); YR> more code YR> printf OFN "egrep\t: %s\n", timestr($etime); YR> is there a way to manipulate the timestr o

Re: Need help on setuid script.

2001-09-01 Thread Maxim Berlin
Hello Matthew, Thursday, August 30, 2001, Matthew Sorenson <[EMAIL PROTECTED]> wrote: [...] MS> I get the error: "Insecure dependency in kill while running setuid at MS> /dev/fd/3". MS> Is there something I can do to satisfy this security condition which will MS> allow perl to complete the acti

Re: adding element to array if a match found

2001-09-01 Thread Maxim Berlin
Hello Jeremy, Saturday, September 01, 2001, Jeremy Lomas <[EMAIL PROTECTED]> wrote: JL> I have a file that I'm reading into an array. The file will be 3 colon JL> delimited fields JL> field1:field2:field3 JL> I then read in another file that has an optional 4th field, and will be JL> noted by

Re: Reading backwards

2001-09-01 Thread Maxim Berlin
Hello Louis-Philippe, Friday, August 31, 2001, Louis-Philippe Dextraze <[EMAIL PROTECTED]> wrote: LPD> Hi everyone, LPD> I'm trying to read throu a 200meg+ error log LPD> file. (I have no administrative rights on this server, LPD> you see i'm just a programmer why would my boss think LPD

Re: Interpolating function call in here documents causes out-of-order execution

2001-09-01 Thread Maxim Berlin
Hello Yusuf, Thursday, August 30, 2001, Yusuf Goolamabbas <[EMAIL PROTECTED]> wrote: YG> The following test program YG> #!/usr/bin/perl YG> sub main() { YG> $key = 5 ; YG> print <<"TARGET" ; YG> Foobar YG> Snafu YG> ${\(interp($key))} YG> TARGET YG> } YG> sub interp { YG> my ($arg) = @_ ; YG

Re[2]: Help with Recursive script on Large Directory

2001-08-28 Thread Maxim Berlin
Hello James, Tuesday, August 28, 2001, Kipp, James <[EMAIL PROTECTED]> wrote: KJ> Thanks so much for your help. Is this how the code should be before I test KJ> it again. It depends of your needs. for example, in your log file you miss full name of files. a good example or educational purpose, b

Re[2]: Writing a log file?

2001-08-28 Thread Maxim Berlin
Hello John, Tuesday, August 28, 2001, Michael Fowler <[EMAIL PROTECTED]> wrote: MF> On Tue, Aug 28, 2001 at 02:42:58PM -0400, John Way wrote: >> Does anyone know how to get a perl script to write out each line of code to >> an output (log) file as it performs each line? (Other than a print >> st

Re: Help with Recursive script on Large Directory

2001-08-28 Thread Maxim Berlin
Hello James, Tuesday, August 28, 2001, Kipp, James <[EMAIL PROTECTED]> wrote: KJ> I have this script that recursed through a directory on a network drive and KJ> it's subdirs flagging files based on a couple of params. KJ> Firstly, I know this will be resource intensive. Is there a better way t

Re[10]: Stripping line breaks

2001-08-26 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: [] >> CS> or am I misunderstanding you? >> >> may be. >> example: >> >> $regex=; chomp $regex; >> $variable=; chomp $variable; >> $a =~ s!$variable!$regex!; >> CS> Well, in this case, I don't see a prob

Re[8]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> >> >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? >> >> >> >> CS> You can. >> >> >> >> CS> $a =~ s!$/!!g; >> >> >> >> CS> Perl just gets confused with the /'s, you have to use alte

Re[6]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Sunday, August 26, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? >> >> CS> You can. >> >> CS> $a =~ s!$/!!g; >> >> CS> Perl just gets confused with the /'s, you have to use alternate >> CS> delimite

Re[4]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Christopher, Saturday, August 25, 2001, Christopher Solomon <[EMAIL PROTECTED]> wrote: >> p.s. does anyone know, why i can not write "$a =~ s/$///g;" ? CS> You can. CS> $a =~ s!$/!!g; CS> Perl just gets confused with the /'s, you have to use alternate CS> delimiters. ok, what about "$!"

Re[2]: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Rory, Saturday, August 25, 2001, Rory O'Connor <[EMAIL PROTECTED]> wrote: ROC> thanks all for your help. It is my understanding that chomp($var); will ROC> only strip the \n from the end of a string. I'm dealing with strings ROC> that could potentially be littered with newline characters

Re: Stripping line breaks

2001-08-25 Thread Maxim Berlin
Hello Rory, Saturday, August 25, 2001, Rory O'Connor <[EMAIL PROTECTED]> wrote: ROC> Another quick one - how can I easily strip line break characters from a ROC> variable? see perldoc -f chomp Best wishes, Maximmailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail

Re: Getting the time

2001-08-25 Thread Maxim Berlin
Hello Rory, Saturday, August 25, 2001, Rory O'Connor <[EMAIL PROTECTED]> wrote: ROC> All I need to do is find out how to get the current date and time from ROC> the server so that I can write it to a logfile I'm creating. How can I ROC> do that? which server do you mean? NTP? or you need local

Re: [ sort ]

2001-08-24 Thread Maxim Berlin
Hello Mellotto, Thursday, August 23, 2001, Mellotto <[EMAIL PROTECTED]> wrote: M> I've tried to sort hash values. The following file shows my problem: M> M> #!/opt/perl5/bin/perl M> %map = ( M> 1 => 1, M> 2 => 10, M> 3 => 200, M

Re: is this sub called correctly? am I missing something?

2001-08-23 Thread Maxim Berlin
Hello Birgit, Thursday, August 23, 2001, Birgit Kellner <[EMAIL PROTECTED]> wrote: BK> my ($db_key, %rec); BK> # %orderhash contains numeric keys and values, like ('43' => '5', '20' => BK> '17'); I want to call the sub get_record for each of these keys. BK> # NOTE: this works perfectly, with th

Re: redirecting print output to a variable

2001-08-23 Thread Maxim Berlin
Hello Bas, Thursday, August 23, 2001, Bas Bloemsaat <[EMAIL PROTECTED]> wrote: BB> I've got this code: BB> #Example of generated code. I have little influence over the actual code in BB> the variable. It's generated from a template. BB> $generatedCode = '$test = "some result"; print "test is: $

Re: a1.a2.a3.a4 -> integer

2001-08-23 Thread Maxim Berlin
Hello P, Friday, August 24, 2001, P lerenard <[EMAIL PROTECTED]> wrote: Pl> I can transform an ip a1.a2.a3.a4 to an integer using Pl> b1=a1 << 24 Pl> b2=a2 << 16 Pl> b3=a3 << 8 Pl> int =b1+b2+b3+a4 Pl> now I want to do the opposite. Pl> how can I get a1.a2.a3.a4 from this integer? Pl> ok I get a

Re: Having a problem with sendmail

2001-08-21 Thread Maxim Berlin
Hello Craig, Wednesday, August 22, 2001, Craig S Monroe <[EMAIL PROTECTED]> wrote: CSM> The script completes, but the mail is never sent. CSM> I do not receive any errors.. CSM> #! /usr/bin/perl -w CSM> use strict; CSM> my $from = "mailer\@testsite\.com"; CSM> my $email = "cmonroe11\@mediaone

Re: k-shell case statement

2001-08-20 Thread Maxim Berlin
Hello Robert, Tuesday, August 21, 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Ric> What is the best perl example of a k-shell case statement as follows: Ric> case "$VAR1" Ric> in take a look at "Basic BLOCKs and Switch Statements" in perldoc perlsyn Best wishes, Maxim

Re: chomp & list

2001-08-20 Thread Maxim Berlin
Hello Jennifer, Tuesday, August 21, 2001, Jennifer Pan <[EMAIL PROTECTED]> wrote: JP> I have a file : JP> #myfile.txt JP> a b c d JP> a c s g JP> g o y g JP> _END_ JP> I wrote a perl script to put each line into a list; JP> #/usr/bin/perl -

Re: Not working in Netscape, working in IE

2001-08-13 Thread Maxim Berlin
Hello Rahul, Monday, August 13, 2001, Rahul Garg <[EMAIL PROTECTED]> wrote: RG> The problem goes like this- RG> value of $mailids is coming from previous perl script RG> if($emailids eq ' ' || $emailids eq '@' || $emailids eq '.' || $emailids !~ /..+/ ) RG> { RG> print <<"enter"; RG> Content-ty

Re: SMTO Socket Connection

2001-08-13 Thread Maxim Berlin
Hello Joel, Monday, August 13, 2001, Joel Divekar <[EMAIL PROTECTED]> wrote: JD> Hi Friends JD> Friday evening I heard a New that there is a change of MTA on our JD> WebServer. And then all my Perl scripts running on our WebServer refuse to JD> send me any stats / logs by email. And this gave

Re: Recursive file copy

2001-08-09 Thread Maxim Berlin
Hello perl newbie, Thursday, August 09, 2001, perl newbie <[EMAIL PROTECTED]> wrote: pn> I am using the following code to do two things: pn> 1) create a unique directory name using @ARGV, and pn> 2) recursively copy the contents of a source directory pn> into the target directories. [..] pn>

Re: Compare large files memory error

2001-08-07 Thread Maxim Berlin
Hello Mbedish, Tuesday, August 07, 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Mac> Is there a better way to compare large files than this snippet, Mac> which runs out of memory if files > 30mb. Mac> It is also slow, about the same speed as comparing in a text editor! Mac> Thank you.

Re[2]: perl interpreter

2001-08-01 Thread Maxim Berlin
Hello Sascha, Wednesday, August 01, 2001, Sascha Kersken <[EMAIL PROTECTED]> wrote: SK> You just CAN'T. SK> What you have to do is install a Perl interpreter on each computer you want SK> to run Perl scripts on. can not agree with you because of laziness. ("The three principal virtues of a progr

Re: readdir

2001-07-27 Thread Maxim Berlin
Hello COLLINEAU, Friday, July 27, 2001, COLLINEAU Franck FTRD/DMI/TAM <[EMAIL PROTECTED]> wrote: CFFDT> I have a problem with my code: CFFDT> #!/usr/bin/perl -w CFFDT> opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!"; CFFDT> $chaine="BEGIN PAPIER"; CFFDT> while($fichier=readdir LMI) C

Re: if in a list

2001-07-26 Thread Maxim Berlin
Hello Jennifer, Thursday, July 26, 2001, Jennifer Pan <[EMAIL PROTECTED]> wrote: JP> I want to test if "AF1" is in my list @mylist; JP> I did: JP> foreach $LIST (@mylist) { JP> if ($LIST = "AF1") JP> $boolean = 1; JP> else JP> $boolean

Re[2]: if in a list

2001-07-26 Thread Maxim Berlin
Hello Jennifer, Thursday, July 26, 2001, Maxim Berlin <[EMAIL PROTECTED]> wrote: MB> $boolean = grep /AF1/,@mylist; sorry, incorrect sample. should be: $boolean = grep /^AF1$/,@mylist; with first regexp you catch every string, that contain 'AF1'. thanks to Moone

Re: Reading binary files

2001-07-26 Thread Maxim Berlin
Hello Sambamoorthy, Thursday, July 26, 2001, Sambamoorthy Jayaraman <[EMAIL PROTECTED]> wrote: SJ> How do I read a binary file?? From this file, I need to read 16 bit values. SJ> I have attached a sample binary file alongwith. When you are reading this SJ> file, enable `hex edit mode'. perldoc

Re: Arrays as subroutines arguments

2001-07-26 Thread Maxim Berlin
Hello Diego, Thursday, July 26, 2001, Diego RiaƱo <[EMAIL PROTECTED]> wrote: DR> How can I pass two arrays as subroutine arguments? passing arrays as arguments is bad idea; you should use references. my_sub(\@array1, \@array2); sub my_sub { my ($ref1,$ref2) = @_; print $$ref1[0], $$ref2[0]; }

Re: help with email submit

2001-07-21 Thread Maxim Berlin
Hello ken, Saturday, July 21, 2001, ken clark <[EMAIL PROTECTED]> wrote: kc> Help. I am very new. I am using this script to create a guestbook entry; kc> however I want it to ALSO email the results to me. I am willing to figure kc> this out myself if someone can point me in the right direction

Re: split

2001-07-21 Thread Maxim Berlin
Hello Greg, Sunday, July 22, 2001, Greg <[EMAIL PROTECTED]> wrote: G> I need to split an array up. I need to split on colons and spaces. I appear G> to be successful splitting on a colon, but am having difficulty doing both. G> Any advice would be appreciated. G> # existing... G> @_ = ($hour,

Re[2]: module question

2001-07-20 Thread Maxim Berlin
Hello Jerry, Friday, July 20, 2001, Jerry Preston <[EMAIL PROTECTED]> wrote: JP> I tried $$ and still no output. What in the module did I do to JP> make you think the $$ would work? do you replace %wdf = $ki->test; with $wdf = $ki->test; too? your module returns a reference(\%wdf), so you s

Re: module question

2001-07-20 Thread Maxim Berlin
Hello Jerry, Friday, July 20, 2001, Jerry Preston <[EMAIL PROTECTED]> wrote: JP> My program to test out my module is: JP> #!/usr/local/bin/perl JP> use CGI; JP> use CGI::Carp qw(fatalsToBrowser); JP> use KI; JP> $ki = new KI(); JP> $query=new CGI; JP> print $query->header(); JP>

Re: Warnings

2001-07-17 Thread Maxim Berlin
Hello paul, Tuesday, July 17, 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: pzcu> So I am finally tightening up my code using strict and -w. [...] pzcu> Produces the warning: pzcu> "Use of uninitialized value in string ne at logisys.pl line 139, line 3" pzcu> Even though the initialise

Re: date

2001-07-13 Thread Maxim Berlin
Hello F.H, Friday, July 13, 2001, F.H <[EMAIL PROTECTED]> wrote: FH> Does anyone know how to get a difference between 2 dates. For instance FH> something like (07/12/01 - 07/13/01) that would get me 1. which date format has your input? in most common case i can recommend convert dates to unixtim

Re: Log::LogLite -- Returning references to log objects

2001-07-13 Thread Maxim Berlin
Hello Michael, Saturday, July 14, 2001, Michael Dube <[EMAIL PROTECTED]> wrote: MD> I am using the Log::LogLite module to facilitate application logging in my MD> script. [...] MD> I so far have been unsuccessful at doing this. Whenever I return $log, it MD> is undefined in the calling module.

Re: C & Perl for loops

2001-07-13 Thread Maxim Berlin
Hello Rich, Friday, July 13, 2001, Busse, Rich <[EMAIL PROTECTED]> wrote: BR> In C, I can do something like this: BR> char ch ; BR> char sz [] = "?:\\dir\\myfile.ini" ; BR> for ( ch = 'c' ; ch <= 'z' ; ch++ ) BR> { BR> sz[0] = ch ; BR>

Re[2]: Help pls %

2001-07-13 Thread Maxim Berlin
Hello Govinderjit, Friday, July 13, 2001, Govinderjit Dhinsa <[EMAIL PROTECTED]> wrote: GD> How do I please get the fields to start from the positions I want GD> them to please; GD> For example I want; GD> $fields[0], (which is 7 characters long to start from position G

Re: to double or to single quotes? that's the question

2001-07-12 Thread Maxim Berlin
Hello Silvio, Thursday, July 12, 2001, Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote: SLLS> Just to confirm some thoughts I had... SLLS> Since double quotes need to be searched for variable interpolation, SLLS> while single quotes don't, I should always (whenever possible) prefer SLLS> si

Re: to double or to single quotes? that's the question

2001-07-12 Thread Maxim Berlin
Hello Silvio, Thursday, July 12, 2001, Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote: SLLS> Just to confirm some thoughts I had... SLLS> Since double quotes need to be searched for variable interpolation, SLLS> while single quotes don't, I should always (whenever possible) prefer SLLS> si

  1   2   >