Thank you, thank you, THANK YOU!
I usually use ssi and perl, php is kinda new, didn't realize that short tags were bad. Is there a reason they are off?...
User Profile
Collapse
-
php.ini seems broken
Hello,
Quick and somewhat stupid question. I have a functioning installation of PHP with apache 1.3.36 (when I <?phpinfo();? >, it works).
However, when I provide a specific configration file (or even the backup copy at php.ini-reccomended), phpinfo() stops working. My first guess is that I did something horrible to the .ini files, but I can't seem to find a way to test them, nor a system backup. I would really... -
-
Sorry... $inv is the actual line from the program (I didn't generic it to $line).
For what it's worth, the actual lines read something like
part number|location |description
What I have been worried about thru the whole affair is the ability to change it to something like
part number|location |description|qu antity...Leave a comment:
-
Whoops, one too many lines!
delete this:
[CODE=perl]%lhs = map { $_ => ''; } @LHS;
%lhs = map { $_ => split (/\|/, $line); } @LHS;[/CODE]
When using split(), it was the only way to avoid the map function returning something like
[CODE=perl]$hash{'var1'} = $var2
$hash{'var3'} = $var4[/CODE]
From out on Google, I can see *how* this happens, but am not sure of the *why*.Leave a comment:
-
OK, using code that looks alot like this:
I got the program working.... but the solution with the temp array and iteration over it seems so inelegant. The program still...Code:@LHS = qw/var1 var2 var3 varn/; %lhs = map { $_ => ''; } @LHS; my @temp = split(/\|/, $inv); my $i = 0; foreach $lhs (@LHS) { $split{$lhs} = $temp[$i]; $i++; }Leave a comment:
-
It doesn't really matter what type is used. All I am looking for it the ability to have (the array of stuff) on the LHS be set from a file somewhere because the call is used in several diff. programs, and going like
($hash{'var1'}, $hash{'var2'}, etc.)
leaves me in the same boat, no?...Leave a comment:
-
Question about LHS assignment with split()
Good afternoon all,
Question about list assignment in perl...
Given a piece of code that looks kinda like this for parsing some '|' delimited input text lines :
[CODE=perl]($var1, $var2, $var3) = split(/\|/, $listline);[/CODE]
Here's the hard part: There are differing programs that read from the same conf file that take data stream and split it, but at some point in the future I may need to expand...
No activity results to display
Show More
Leave a comment: