Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Alphabin
  • Content: Threads
  • Order by date
  1. Alphabin

    Cookie-based Login

    I'm using the following code for a cookie-based login. The script has no syntax error, but it is not able to send the cookie to the user's browser. In IE, it's processing for over 2 mins and then I get a timeout error. Any help would be greatly appreciated. I'm using CGI 2.98 w/ Perl 5.6.1 on...
  2. Alphabin

    Perl - Cookie Login

    I'm using the following code for a cookie-based login. The script has no syntax error, but it is not able to send the cookie to the user's browser. In IE, it's processing for over 2 mins and then I get a timeout error. Any help would be greatly appreciated. I'm using CGI 2.98 w/ Perl 5.6.1 on...
  3. Alphabin

    Pushing elements of Hash ?

    I would like to know how to push a hash to use it later on (in another sub-routine). I know the push function only applies for arrays but is there a similar function for hashes ? Here's the current coding I have. [code] for (keys %members) { if ($input{'pv'} eq $members{$_}{'region'}) {...
  4. Alphabin

    Sorting alphanumeric

    Hi, I'm trying to sort alphanumeric data. Here's an example of the numbers: 33311a 33311b 33312 33313 Right now I'm using the "cmp" operator but I get the following results: 33312 33313 33311a 33311b Coding: $case{$a}{$num} cmp $case{$b}{$num} Thanks
  5. Alphabin

    Flat File w/ delimiters - Quick Question

    Hi, I have data in a flat file seperated by delimiters. Ex: ID09000|Name|Name02|23 I'm using the following code in order to split all this and put it into an array: my @field=split(/\|/,$record); chomp $record; Now if I want to use the value (for comparaison etc..) in the $field[3]...
  6. Alphabin

    Sort by date (w/o module)

    Hi, I would like to know if there is a simply way to sort by date. Dates are the the following format: $date = yyyy-mm-dd Right now I'm doing a simple num sorting (which certainly doesnt work) sub sorting { $b->[14] <=> $a->[14]; }
  7. Alphabin

    Defining Array (Quick Question)

    Hi, I'm trying to extract dates (from flat file) which are in the following format: yyyy-mm-dd and then split the field to create an array... Here's a simplified version (no flat file) You will notice that only extract 3 dates out of 4 are extracted. Thank you in advanced while(<DATA>) {...
  8. Alphabin

    Regex - Date validation

    I know it may have been already discussed in the past, but I need a simple regex to validate dates in the following format: yyyy-mm-dd Thank you
  9. Alphabin

    Array problem

    I have the following: open(FILE,"$File.txt") || die("Could not open file!"); my @Data=<FILE>; close(FILE); foreach my $record (@Data) { chop $record; my @field=split(/\|/,$record); if ($input{'srh'} == $field[5]) { push (@found,[@field]); print $field[0]; } } Now I want to store...
  10. Alphabin

    Array Manipulation (Selecting Elements)

    I want to select elements from x to y in the array. Right now, the code I have selects x and y foreach my $Results (@records[$first,$last]) { print "$Results \n" } Thank you in advance
  11. Alphabin

    Advanced Sorting - Quick Question

    Hi, I have a flat file with the following structure: DataTest.txt 210|Roger|Brodie|RB|NY| 221|Jake|Namol|JK|NY|210 223|Matt|Lamon|MM|NY|221 227|Litia|Lumberg|LM|NY|221 211|Peter|Givens|BV|NY| 224|Rob|Lumen|RB|NY|211 234|Lopez|Lucas|LL|NY|211 Note: Field 0 is User ID Field 5 is Parent...
  12. Alphabin

    Quick Phone Number RegEx Question

    I have phone number in the following format: (xxx) xxx-xxxx ext. xxxxx I need a RegEx so I can extract the 4 parts. I have this right now m|[(]?(\d{3})[)][ ]?(\d{3}\d?)[-](\d{4})[ ][ext.][ ]?(\d{5})|g
  13. Alphabin

    Redirecting w/o using &quot;Location&quot;

    Since I'm generating HTML output with print "Content-type: text/html\n\n" the print "Location: ..." function is not an option for me. I know there's other ways to do so... Any input would be appreaciated..
  14. Alphabin

    url pattern matching

    Hi, I'm trying to come up with a url pattern matching... If a URL is not an valid URL don't display it. What I have so far if ($URL =~ /(http:\/\/[0-9A-Za-z._&?=%\/~-]+)/) { print qq!<a href="$URL">$URL</a> \n!; } It's not working so far...
  15. Alphabin

    RegEx Quick Question

    I'm no ASP Programmer and I need an advice from you guys. I'm trying to pass a URL with parameters... To validate the URL, I have the following RegEx pattern. http://.+?(/.* This will ignore a URL with parameters separated by & (Ampersand) characters... Right ? Ex...
  16. Alphabin

    Quick Question - $ENV{'SERVER_NAME'}

    If have specific properties for different server name. I came up with following: $Server = "$ENV{'SERVER_NAME'}"; $S1_SN = 'www.domain1a.com' || 'www.domain1b.com'; $S2_SN = 'www.domain2a.com' || 'www.domain2b.com'; if ($Server == $S1_SN) { $stylesheet = 'style.css'; } else { $stylesheet...
  17. Alphabin

    Dates Manipulation

    Hi experts, I'm working on something that will only display data in the "Last xx days" (Selected by user) Here's what I have: FYI: $fields[14] is the string for the field in flat file that contains the date stamp in the following format: dd/mm/yyyy $year,$mon,$mday is the current date if...
  18. Alphabin

    Date Verification (Operators)

    I want to extract records modified on the current date The $fields[14] is structure as follow: dd/mm/yyyy Example: 5/3/2004 $year,$mon & $mday are the current date strings my ($fld_day, $fld_mon, $fld_year) = split(/\//,$fields[14]); if (($year-$fld_year=0) && ($mon-$fld_mon=0) &&...
  19. Alphabin

    URL's with parameters. Can't display

    Hi, I'm trying to link URL's with parameters (Links stored in flat file) and I'm not getting successful results: Flat file is structured as follow: Name=Home Page Link=http://www.linkhere.com/library/display.asp?app=post&order=num The line to display URL print "<a href=\"$Link\">$Name</a<" ...
  20. Alphabin

    Using map / Separating results

    Hi, My first thread was not very clear so I decided to create another one. My objective is that the following fields (stored in flat file) would be displayed by category. The category would be the state which is the field [3]. -> Flat File Structure: John|Lopes|Student|OH...

Part and Inventory Search

Back
Top