Can someone help me?
Hello all. I have a program that if a member bypasses make their payment, it recorder their IP, Date, and time into a log file. I'm setting up an admin page to login and view the contents. Its listed in the text file as 19.254.63.98 | Oct 3 2002 | 9:58 | I open the directory like this. opendir (LOG, $cgiroot/thieftlog);files = grep { /.txt/ } readdir(DIR);close (DIR); How do I print out the contents of the txt file in html format? I want it to list the information on lines in a table. IP DateTime. Thanks and God Bless Dan
Re: Can someone help me.
Bootscat wrote at Tue, 01 Oct 2002 00:10:32 +0200: I'm setting up a list for free and pro members. I want the pro members to be able to mail daily. I have this part working. I want the free members to only be able to mail every 4 Days to the list. Using the localtime(time) = (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year) Can someone tell me how to code it to only allow it to mail every 3 days? Here's the code I already have working. I'm just adding a free members to mail every 4 Days. I have it checking the LSend file to see when mail was last sent like this. if($lastsend eq $date){ If work geat for everyday mailings. But how do I have it check the LSEND to work for every 3 or 4 days? my ($sec,$min,$hour,$dom,$mon,$year,$dow,$doy) = localtime; if ( not $doy % 3 ) { sendmail(); I ignore your huge script, as the basic idea is very simple. You need a key-value structure of your free members (the keys should be their member_ids, names or whatever they are identified unarbitrarely, the value should be the (year,month,day)-date of the last succeeded mailing). The key value structure can be a tied hash, a database, a flat file csv file or anything else, it isn't so important. Then all you have to do is something like this PseudoCode: use POSIX qw/strftime/; use Date::Calc; # available from CPAN my $current_date = strftime %y%m%d; if (Delta_Days($last_send_mail_date{$user}, $current_date) = 4) { sendmail; last_send_mail_date{$user} = $current_date; } Of course, you can also use the direct way instead of the strftime function, but I always forget the return parameters of localtime :-)) Best Wishes, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can Someone Help Me?
I'm setting up a list for free and pro members. I want the pro members to be able to mail daily. I have this part working. I want the free members to only be able to mail every 4 Days to the list. Using the localtime(time) = (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year) Can someone tell me how to code it to only allow it to mail every 3 days? Thanks Dan
Re: Can Someone Help Me?
.--[ Bootscat wrote (2002/09/30 at 09:13:19) ]-- | | I'm setting up a list for free and pro members. | I want the pro members to be able to mail daily. I have this part working. | | I want the free members to only be able to mail every 4 Days to the list. | | Using the localtime(time) = | (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year) | | Can someone tell me how to code it to only allow it to mail every 3 days? | `- Without knowing how your E-mail mailing list software works, this may not even be possible. However to for an easy way to get every third day I would suggest you look at Date::Calc or Date::Manip modules on cpan.org as they have several easy functions for working with dates. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can someone help me.
I'm setting up a list for free and pro members. I want the pro members to be able to mail daily. I have this part working. I want the free members to only be able to mail every 4 Days to the list. Using the localtime(time) = (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year) Can someone tell me how to code it to only allow it to mail every 3 days? Here's the code I already have working. I'm just adding a free members to mail every 4 Days. I have it checking the LSend file to see when mail was last sent like this. if($lastsend eq $date){ If work geat for everyday mailings. But how do I have it check the LSEND to work for every 3 or 4 days? my ($sec,$min,$hour,$dom,$mon,$year,$dow,$doy) = localtime; if ( not $doy % 3 ) { sendmail(); Any light you could shed on this would be great. Thanks and God Bless Dan # SEND MAIL TO LIST MEMBERS # sub send{ print $q-header; checklogin; header; if ($banner eq yes) {banner1;} print qq| CENTER FORM ACTION=$htmldir/members.cgi METHOD=POST font face=$base_font size=3 color=$txtcolorbSend Your Message To The Entire Safelist Using The Form Below/b p TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 TR TD ALIGN=LEFTfont face=$base_font color=$txtcolorFrom:/font/TD TD ALIGN=LEFTfont face=$base_font color=$txtcolor$sub ($first)/font/TD /TR TR TD ALIGN=LEFTfont face=$base_font color=$txtcolorSubject:/font/TD TD ALIGN=LEFTINPUT TYPE=TEXT NAME=subject SIZE=50/TD /TR TR TD ALIGN=CENTER COLSPAN=2 font face=$base_font color=$txtcolorEnter Your Message Below:/fontbr TEXTAREA NAME=message ROWS=12 COLS=60/TEXTAREAbrbr INPUT TYPE=HIDDEN NAME=username VALUE=$username INPUT TYPE=HIDDEN NAME=password VALUE=$password /TD /TR TR TD COLSPAN=2 ALIGN=RIGHTINPUT TYPE=SUBMIT NAME=action VALUE=Send This Messagenbsp;nbsp;nbsp;nbsp;nbsp;/TD /TR /TABLE /FORM /font /CENTER br |; footer; unlink $cgiroot/data/lsend/addys.txt; open (NFILE, $cgiroot/data/lsend/addys.txt); flock(NFILE, 2); opendir (DIR, $cgiroot/data/members); files = grep { /.txt/ } readdir(DIR); close (DIR); foreach $file (files){ open (MEMDATA, $cgiroot/data/members/$file);flock(MEMDATA, 2);(memlines) = (MEMDATA);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode,$memconfirm,$status,$extra2,$extra3) = split (/\|/, $memline); } ($memuser,junk) = split (/\./, $file); if(($status !~ /vacation/i) ($memcode eq )){ print NFILE $memsub|$memfirst|$memuser|$mempass|\n; }else{} } flock(NFILE, 8); close (NFILE); exit; } # MAIL MESSAGE TO LIST MEMBERS ## sub dosend{ print $q-header; checklogin; getdate; header; if ($banner eq yes) {banner1;} if($subject eq ){print qq|centerbfont face=$base_font color=$txtcolorYou forgot to enter a subject! try again.../font/b/center|;exit;} if($message eq ){print qq|centerbfont face=$base_font color=$txtcolorYou forgot to enter a message! try again.../font/b/center|;exit;} $length=length($message); if ($length 2500){ print qq| center font face=$base_font size=3 color=$txtcolorb Your message is too large! Maximum message length is 2500 bytes. Your message is $length bytes long. Please shorten it, and try again./b /font br/center|; exit;} if($lastsend eq $date){ print qq| center font face=$base_font size=3 color=$txtcolorb You cannot send a message right now!/b /font br font face=$base_font color=$txtcolorYou will have to wait at least 24 hours before you can send again./font br br a href=$htmldir/members.cgi?action=mainusername=$usernamepassword=$password style=color:$lnkcolor;click here to continue/a /center br |; exit; } if ($status =~ /vacation/i){ print qq| center font face=$base_font size=5 color=$txtcolorb You cannot send a message right now!/b /font br font face=$base_font color=$txtcolorYour account is in Vacation status./font br br a href=$htmldir/members.cgi?action=mainusername=$usernamepassword=$password style=color:$lnkcolor;click here to continue/a|; exit; } if($code ne ){ print qq| center font face=$base_font size=5 color=$txtcolorb You cannot send a message right now!/b /font br font face=$base_font color=$txtcolorYou have not validated your subscription email address yet./font br br a href=$htmldir/members.cgi?action=mainusername=$usernamepassword=$password style=color:$lnkcolor;click here to continue/a \| a href=$htmldir/members.cgi?action=resendcodeusername=$usernamepassword=$pa ssword style=color:$lnkcolor;resend validation code/a /center br |; }else{ print qq| center font face=$base_font size=5 color=$txtcolorb Emailing Results Will Be Displayed Below!/b /fontbr smallfont face=$base_font color=$txtcolorWait until you see The Emailing Is Now Complete! at the bottom, Do not hit refresh!/font/small /center br br |; open (LSEND, $cgiroot/data/lsend/addys.txt); flock(LSEND, 2); (lines) = (LSEND); flock(LSEND, 8); close (LSEND); foreach $line (lines){
RE: Can someone Help me out with this
Problem: ci_cmd1=abcdef, // line1 ci_cmd2=ghijk, // line2 ci_cmd3=lmnop, // line3 ci_cmd4=pqrst, // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1=lmnop, ci_cmd2=pqrst, Where are these lines? Are they in a file? Are they in a variable? Can you post some code that you've tried? Cheers, -dave Regards., Avi Like Avi from Snatch? =P Got anything to declare? Yeah, don't go to England. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can someone Help me out with this
you should try this. $old=abcdef; $new=lmnop; $ci_cmd1 = s/$old/$new/;#this substitutes the old value with the new one. regards, Ian David Gray wrote: Problem: ci_cmd1=abcdef, // line1 ci_cmd2=ghijk, // line2 ci_cmd3=lmnop, // line3 ci_cmd4=pqrst, // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1=lmnop, ci_cmd2=pqrst, Where are these lines? Are they in a file? Are they in a variable? Can you post some code that you've tried? Cheers, -dave Regards., Avi Like Avi from Snatch? =P Got anything to declare? Yeah, don't go to England. -- 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: Can someone Help me out with this
I don't know if this is the most efficient way to do it, but it worked. #!C:\Perl\bin\perl.exe -w use strict; my $infile = qq(C\:\\cmd.txt); my $outfile = qq(C\:\\cmdout.txt); my $cmdline; open(IN,$infile) or die Whoops! Look what happened. $! \n; open(OUT,$outfile) or die Could not open \'cuz $! \n; while(IN) { my $line = $_; if(($line =~ /cmd1/) or ($line =~ /cmd2/)) { next; } else { $_ =~ s/(\n)+(\r)+//g; ($cmdline) = split(/,/,$line); print OUT $cmdline \n; } } close(OUT); # blue light special on aisle #6 close(IN); # we've got the suspect surrounded 1; Scot R. -Original Message- From: Avanish Pathak [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 2:02 AM To: Troy May; Bill Lyles; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Can someone Help me out with this Hi , Can some one provide me with a perl script for this: Problem: ci_cmd1=abcdef, // line1 ci_cmd2=ghijk, // line2 ci_cmd3=lmnop, // line3 ci_cmd4=pqrst, // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1=lmnop, ci_cmd2=pqrst, A prompt response will be highly appreciated. Regards., Avi - Original Message - From: Troy May [EMAIL PROTECTED] To: Bill Lyles [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, April 17, 2002 8:52 AM Subject: RE: Definition It just makes dealing with quotes alot easier. And you don't need to escape the extra quotes within it. For example, print value=\true\; print qq!value=true!; print qq/value=true/; are all the same. The qq uses the next character instead of the character. Then you must end the line with the same character you started with. (qq!!, qq//, qq~~) Sorry, it's hard to explain in an email. -Original Message- From: Bill Lyles [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 16, 2002 7:31 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Definition Ok, Sorry about that Anyway what do you mean perldoc -f qq? what does the ~qq mean? - Original Message - From: fliptop [EMAIL PROTECTED] To: Bill Lyles [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 8:53 PM Subject: Re: Definition Bill Lyles wrote: href=file://C:\Program Files\Common Files\Microsoft Shared\Stationery\ As I am somewhat new to perl can someone tell me what this means $header = qq~ I understand the header but what is the qq~ for? perldoc -f qq btw, it's considered bad form to send html-ized email to the list. -- 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can someone help me???
@$foo{bar} What you intend by the above is the scalar value in $foo{bar} dereferenced as an array by the @. But that's not what happens. To achieve what you want, use: @{$foo{bar}} The issue here is precedence of sigils (@, $, etc.) versus subscript parens ({}, []), and the meaning of various combinations of sigils and subscripts. Sigils have a higher precedence than subscripts. To force the meaning you wanted, we, well, forced the meaning you wanted. Fwiw, @$foo{bar} specifies that you want a list, consisting of the values corresponding to the list of keys in the parens (in this case a list of length 1, namely bar), looked up in the hash referenced by $foo. So, this should work: %h = (key='value', key2='value2'); $foo = \%h; print @$foo{key, key2}; hth.