perl Makefile.PL PREFIX=/u/mydir/perl
####
16:27 dpkg -i filename.deb
16:29 that unpacks only, right?
16:30 alexander: dpkg's in-line help is pretty complete.
The manpage and info page both include thorough
information as well.
16:30 alexander: dpkg -i unpacks and installs
16:32 if you're looking to install a common
application/package and you're not familiar with
apt, aptitude, tasksel (more redhatish), or
dselect, check those out.
16:37 ok i will - finding the relevant docs is
still seldom easy for me to do without
asking - all my searches were fruitless, so
thank you (i am going to try installing
openssl is why I was wanting to know)
16:42 alexander: try and 'apt-get install openssl' before
you mess with dpkg.
16:42 if apt is set to go to an internet source, it will
probably get newer stuff
16:45 oh, alright - i'll do that instead
16:47 the debian site says "libc6" and "libssl" are
possible dependancies (is the "6" in "libc6"
a version number? would i just want to say
'apt-get install libc'?)
16:50 apt-get should try to get the dependencies that
aren't already installed.
16:50 but yes, libc6 is libc - version6.
16:50 which is basically listed as /lib/libc-2.x.x.so or
whatever.
16:51 oh alright - that certainly simplifies things
16:51 check your /etc/apt/sources.list and see if it
points to a CD-ROM source or an http/ftp source.
16:51 alright...
16:53 yes - it is set to ftp and http sources
16:53 alexander: if you have extra time to waste, do a
'apt-get update && apt-get dist-upgrade' to
upgrade the whole box's complement of software.
16:54 join the debian horde
16:54 oh.... how much "extra time" are you
talking about?
16:55 it'll go out and download about 3MB of indicies
and compare your versions to the current versions.
16:55 depends on your connection :)
16:55 dsl fortunately
16:56 if I take a stock box on my DSL and upgrade, it
would take prolly 40 minutes.
17:01 thank you :-)
17:01 np, have fun
####
From
/usr/alexander/web-root
To
/usr/alexander/ssl-root
####
it will work if $var looks something like this $var = ["A", 1] or @array = (1,2);$var = \@array; Try this: perl -le '$var = ["a","b",3]; print $var"
it should print something like:ARRAY(0x224eb4)
which is an array reference... so if you did this: perl -le '$var ="A","b",3; ($var1,$var2,$var3) = @{$var}; print "$var1, $var3,$var2";' all should be good with the world...
####
alexander another problem you have is your are sending more than just a hash as a parameter for SetCookie(%hash) which is also screwing you up...that is the odd number of elements warning you are getting..
####
#$ENV{'CUSTOMENV'} = 'value';delete $ENV{CUSTOMENV}; -or- $ENV{PATH} = undef;
# what about unsetting them?
# same as any other hash: delete $ENV{CUSTOMENV}
# ummm... $ENV{PATH} = undef; or delete $ENV{PATH}; should work
# oh fantastic! ...are there any pros/cons to one or the other method of unsetting them?
# undef makes it undefined... delete removes completely from the hash.. so it no longer even exists... i would use delete..
# huh? "autovivify" -?!?
#Enlil notes that Alexander should look up exists, defined, and delete
# Also, look up ENV in perlvar.
# perldoc++++
# how do i do 1.00 + 1.00 = 2.00 instead of 1.00 + 1.00 = 2 and 1.00 + 1.50 = 2.50 instead of 1.00 + 1.50 = 2.5 --?
# you just format the output with sprintf, alexander
# (cos 2.50 == 2.5 )
# my $var = sprintf("%.2f",1.00 + 1.004); print $var;
#perl -le 'my $var = sprintf("%.2f",1.00 + 1.004); print $var;'
perl -le 'printf("%.2f",1.00+1.032);'
printf is like sprintf, except that it prints the formatted string, rather then returning it.
(You could say that the other way around, which is more historicly accurate, and makes the names make sense.)
Printf also ignores $\, as you've noticed; -l is of no help.
happen to know why?
I don't know. I suspect because it simply uses printf directly from C.
nods.
If there was, or is, a rationale for why it should be that way, I haven't heard it.
i have seen the light and now understand the niftiness of the printf now. wow, perl -e 'printf("%.2f", 1 .00+1.032 .00+74);' equals 85.03!
there is no shame spending an afternoon looking at [http://www.perldoc.com/perl5.8.0/pod/perlfunc.html|perlfunc] for new never used functions... like [http://www.perldoc.com/perl5.8.0/pod/func/ucfirst.html|ucfirst] is good when needed too:)
Enlil says autovivify... try this:use strict;use warnings;use Data::Dumper;my %hash;if($hash{this}{that}){print "nope";}print Dumper \%hash; :) i just meant be careful how you check for existence and whatnot:)
castaway, was "unique for each environment.." for me? (and if so, is that a "yes, each user will safely get the data unique to them and them alone"?)
yes it was.. and yes they should
(each login creates a new environment..)
Alexander, requests from different users will still hit web server processes at random so ENV variables will jump between users randomly.
castaway didnt know Alexander was talking about web server stuff.
####
#!/usr/bin/perl -w
# bourne.pl "monkified" v1.0
# bart lines 5 & 29, and theorbtwo for ! delimiters line 36
use strict;
############
## note: six assumptions are made here...
## 1) $USER legal characters are alphanumeric, "_", or "-"
## 2) $USER is between 3 and 16 characters in length
## 3) your default shell is a bourne-like shell (like bash)
## 4) you know enough bourne shell to not get in trouble
## 5) your $HOME directory is /home/$USER
## 6) you accept that you are using this at your own risk
my @cmds = split /\n/, <<'--CMDs--';
############
## edit
whoami
pwd
id
echo \$PATH=$PATH
echo \$PERL5LIB=$PERL5LIB
perl -V
############
## no edit
--CMDs--
my $i=4;
my $size=@cmds;
my $me=`whoami`;
my $dir=`pwd`;
$me=~s/\n//;
$dir=~s/\n//;
$dir=~s!\/home\/[\w-]{3,16}\/!\/!;
my $prompt="$me\@~$dir>";
print "Content-type: text/plain\n\n";
while ($i <= $size - 4) { my $cmd=$cmds[$i]; print $prompt,"$cmd\n",`$cmd`,"\n"; $i++; }
####
sub UpdateCart {
#print "Content-type:text/plain\n\n";
my (@itemquantities, $itemnum, $itemqty, $baseprice, $upsizeamt);
if (&GetCookies('itemprice')) { # if item price, get values
my $rawvalue = pop(@Cookie);
($itemnum, $itemqty, $baseprice, $upsizeamt) = split(/;/, $rawvalue);
@itemquantities = split(/\|/, $itemqty);
} else {
die "Missing Cookie: itemprice! It is required to use the cart.";
}
my $number = $query->param("number");
my $i = "0";
my $count = "0";
while ($count <= $number) {
my $update = $query->param($count);
$itemquantities[$i] = $update;
$i++;
$count++;
}
#if ($number eq "0") {
# $itemqty = $itemquantities[0];
# my $new_itemprice = "$itemnum;$itemqty;$baseprice;$upsizeamt";
# &SetCookies("itemprice",$new_itemprice);
#} else {
$itemqty = $itemquantities[0];
$i = "0";
$count = "1";
while ($count <= $number) {
$i++;
my $temp = "$itemqty\|$itemquantities[$i]";
$itemqty = $temp;
$count++;
}
my $new_itemprice = "$itemnum;$itemqty;$baseprice;$upsizeamt";
# print "New Itemprice: $new_itemprice\n";
&SetCookies("itemprice",$new_itemprice);
#}
##############################################################################
##############################################################################
&GetCookies('total');
my $rawvalue = pop(@Cookie); # get raw totals
my ($itemt, $subt, $grandt, $ouncest, $shippingt) = split(/;/, $rawvalue); # get totals from raw totals
&GetCookies('itemprice');
$rawvalue = pop(@Cookie);
($itemnum, $itemqty, $baseprice, $upsizeamt) = split(/;/, $rawvalue);
my @itemnumbers = split(/\|/, $itemnum);
@itemquantities = split(/\|/, $itemqty);
my @baseprices = split(/\|/, $baseprice);
my @upsizeamounts = split(/\|/, $upsizeamt);
&GetCookies('details');
$rawvalue = pop(@Cookie);
my ($isize, $icolor, $istyle, $iounces) = split(/;/, $rawvalue);
my @itemsizes = split(/\|/, $isize);
my @itemcolors = split(/\|/, $icolor);
my @itemstyles = split(/\|/, $istyle);
my @itemounces = split(/\|/, $iounces);
&GetCookies('itemtitle');
my $ititle = pop(@Cookie);
my @itemtitles = split(/;/, $ititle);
############################################################################
############################################################################
$i = "0";
my @remove = $query->param("remove");
my %remove;
@remove{@remove} = (1)x@remove;
@itemnumbers = @itemnumbers[ grep !$remove{$_}, 0..$#itemnumbers ];
@itemquantities = @itemquantities[ grep !$remove{$_}, 0..$#itemquantities ];
@baseprices = @baseprices[ grep !$remove{$_}, 0..$#baseprices ];
@upsizeamounts = @upsizeamounts[ grep !$remove{$_}, 0..$#upsizeamounts ];
@itemsizes = @itemsizes[ grep !$remove{$_}, 0..$#itemsizes ];
@itemcolors = @itemcolors[ grep !$remove{$_}, 0..$#itemcolors ];
@itemstyles = @itemstyles[ grep !$remove{$_}, 0..$#itemstyles ];
@itemounces = @itemounces[ grep !$remove{$_}, 0..$#itemounces ];
@itemtitles = @itemtitles[ grep !$remove{$_}, 0..$#itemtitles ];
if (@remove) {
# foreach my $item (@remove) {
# print "Splice: $item\n";
# $item -= $i;
# $i++;
# splice(@itemnumbers, $item, 1);
# splice(@itemquantities, $item, 1);
# splice(@baseprices, $item, 1);
# splice(@upsizeamounts, $item, 1);
# splice(@itemsizes, $item, 1);
# splice(@itemcolors, $item, 1);
# splice(@itemstyles, $item, 1);
# splice(@itemounces, $item, 1);
# splice(@itemtitles, $item, 1);
# }
$ouncest = "0";
foreach my $item (@itemounces) {
# print "Itemounces: $item\n";
my $temp = ($ouncest + $item);
$ouncest = $temp;
}
&ShippingChart($ouncest);
$shippingt = shift(@NewShipping);
$itemt = "0";
foreach my $item (@itemquantities) {
# print "Itemquantities: $item\n";
my $temp = ($itemt + $item);
$itemt = $temp;
}
my $count = "1";
$subt = "0";
$i = "0";
while ($count <= $number) {
my $temp = sprintf("%.2f",$baseprices[$i] + $upsizeamounts[$i]);
my $itemprice = sprintf("%.2f",$temp * $itemquantities[$i]);
$temp = sprintf("%.2f",$subt + $itemprice);
$subt = $temp;
# print "Subtotal$i: $subt\n";
$i++;
$count++;
}
$grandt = sprintf("%.2f",$subt + $shippingt);
my $new_total = "$itemt;$subt;$grandt;$ouncest;$shippingt;";
&SetCookies("total",$new_total);
#$count = "1";
$itemnum = $itemnumbers[0];
$itemqty = $itemquantities[0];
$baseprice = $baseprices[0];
$upsizeamt = $upsizeamounts[0];
# print "(0) Itemnumber: $itemnum, Itemquantity: $itemqty, Baseprice: $baseprice, Upsizeamount: $upsizeamt\n";
if ($itemnumbers[1] and $itemquantities[1] and $baseprices[1] and $upsizeamounts[1]) {
$i = "1";
# while ($count <= $number) {
for (1..$#itemnumbers) {
my $temp = "$itemnum\|$itemnumbers[$i]";
$itemnum = $temp;
$temp = "$itemqty\|$itemquantities[$i]";
$itemqty = $temp;
$temp = "$baseprice\|$baseprices[$i]";
$baseprice = $temp;
$temp = "$upsizeamt\|$upsizeamounts[$i]";
$upsizeamt = $temp;
# print "($i) Itemnumber: $itemnum, Itemquantity: $itemqty, Baseprice: $baseprice, Upsizeamount: $upsizeamt\n";
$i++;
# $count++;
}
}
my $new_itemprice = "$itemnum;$itemqty;$baseprice;$upsizeamt";
&SetCookies("itemprice",$new_itemprice);
#$count = "1";
$isize = $itemsizes[0];
$icolor = $itemcolors[0];
$istyle = $itemstyles[0];
$iounces = $itemounces[0];
# print "(0) Itemsize: $isize, Itemcolor: $icolor, Itemstyle: $istyle, Itemounces: $iounces\n";
if ($itemsizes[1] and $itemcolors[1] and $itemstyles[1] and $itemounces[1]) {
$i = "1";
for (1..$#itemsizes) {
# while ($count <= $number) {
my $temp = "$isize\|$itemsizes[$i]";
$isize = $temp;
$temp = "$icolor\|$itemcolors[$i]";
$icolor = $temp;
$temp = "$istyle\|$itemstyles[$i]";
$istyle = $temp;
$temp = "$iounces\|$itemounces[$i]";
$iounces = $temp;
# print "($i) Itemsize: $isize, Itemcolor: $icolor, Itemstyle: $istyle, Itemounces: $iounces\n";
$i++;
# $count++;
}
}
my $new_details = "$isize;$icolor;$istyle;$iounces";
&SetCookies("details",$new_details);
#$count = "1";
$ititle = $itemtitles[0];
# print "(0) Itemtitle: $ititle\n";
my $new_itemtitle;
if ($itemtitles[1]) {
$i = "1";
for (1..$#itemtitles) {
# while ($count <= $number) {
my $temp = "$ititle;$itemtitles[$i]";
$ititle = $temp;
# print "($i) Itemtitle: $ititle\n";
$i++;
# $count++;
}
$new_itemtitle = $ititle;
}
&SetCookies("itemtitle",$new_itemtitle);
}
my $location = "/cart/action?is=view";
print $query->redirect(-uri=> $location), "\n\n";
exit 0;
}