I think this question is best posed with an example:
Here's a sample array:
@array=qw(
11111
22222
33333
xxmeta
xxdata
);
There could be more, less, or no 'xx...', and the length of the array varies. Given that, how would I reference the last line in the array...
I've come up with a simple shell script that works, but I want to refine it a bit so maybe some others can use it. Basically, it allows to me open a file from certain directory regardless of my cwd:
vi `ls /home/jriggs/dox/*"$*" `Lets me just enter last part of the file, and there it is.
I...
I have a relatively small, but aggravating problem on my apache server. Some script kiddie somewhere keeps trying to telnet into my server with a very crude brute force prog. I see it in my auth.log file as
Jul 24 14:17:03 localhost sshd[4506]: Illegal user amanda from 218.202.223.244
Jul 24...
I'm pretty new to C#. Currently I am trying to work with Microsoft's 2005 Visual C# express. Here's what I'm trying to accomplish:
1) Browse to a word doc on my Computer
2) Read .doc into a text box
3) Do some modifications to the contents
4) ftp revised text in .txt format to my server
I am at...
Hi All,
I'm totally new to OO programming, well more precisely microsoft .net style syntax. I recently downloaded Visual c# express, I want to learn, but am having a difficult time getting started. Mainly I think I'm searching the wrong terms. My first goal is to open a word doc in my...
I'm using a text file to hold some information about files, like a mini-database (I know, I know). I'm trying to write a little sub-routine that will let the user enter 1, 2, OR 3 terms, and will return results arranged by relevence. Like m/($term1 AND $term2 AND $term3) then m/($term1 AND...
I'm looking for a way to kill a script on user input from the keyboard. I was originally trying to use a while loop, but that didn't really accomplish what I wanted (at least the the way I did it). Some folks over on the CB at perlmonks recommended using perl's fork function. I read the...
I wasn't sure if I should post here, or in the cgi forums, but I think my problem is more perl than anything else. This script
#!/usr/bin/perl
use CGI qw(:standard);
use Image::Magick;
print header;
print "<link rel=\"stylesheet\" ";
print "type=\"text\/css\"...
Hi All-
I have the following code which is pretty straight forward, for getting data into a form the 'real' script can use.
7 while ($ln=<DATA>){if ($ln!~ /^\s*$/){
8 $ln=~ s/(^[1-9])/\n$1/g;
9 push @goodat , $ln;}
} This output looks as it should when I print...
It seems like most of my posts start this way but: Is it possible to use CGI to upload a file to my server? I'm trying to put an html page on my server that has a browse button, text box, and will allow someone (at this point I suppose anyone) to upload a file onto my server. I have physical...
Hi all,
This works
ls joe/home/*"$*"fine as a shell script. But how can I tell the shell to also return files which are optionally followed by a single letter, 'x' for example. I think using another wildcard will make this regex too greedy, TIA
Because a thing seems difficult for you, do not...
Hi all! Hope I'm not posting on the wrong section: I'm looking to upgrade my video card for <$150. Here's some specs
emachines t6410
3200+amd athlon 64 processor
windoze xp homeBasically, I need I card that's going to last about a year or so. This box came with an ati express 200 (integrated...
Hello World!
I'm trying to capture the text that follows a set pattern. For example:
___DATA_____
User name=jriggs
In this simple scenario I would like the script to search the text file until it finds the above line, and then set. $uname='jriggs'...Of course $uname won't always be 'jriggs'...
I have this code
3 @alpha=("Names","Steve","Linus","Larry","Bill");
4 @alpha=sort(@alpha);
5 foreach $name (@alpha){print $name."\n";}
6 #print @alpha;
Suppose I only wanted to sort $alpha 1-4 (every line but the first one), how would I go about this? I'm looking...
Hello again,
I have the following loop:
20 my $line;
21 foreach $line (@_){ do sth ; }
Simple enough, but I can't figure out how to only set $line equal to strings that contain no text (blank whatever). I have tried the following conditions in various places within the loop with...
How can I check for blank lines in a textarea, and remove them? I am thinking that I will need to populate an array with the data from the textarea first. Ideally, I would like to be able to perform this before the data is submitted and do it automatically. Also, I would like to be able to...
Whenever I ftp a file into vi, I get these characters in the file. It's strange since copy/pasting doesn't show them, but rather the ' or " as appropriate. I would prefer to use ftp though, as it is much faster/cleaner.
So my question is other than doing a bunch of s/x\\92/\'/;(which I have yet...
Hi all. I'm not sure if this is even possible with javascript or not, but I thought I'd give it a shot...I am wanting to write a simple app that can be run locally on my computer. All I need it to do is take data from 3 seperate text boxes and join them together into a single dataset, then...
I need to format a string of data, but I don't want to start each string w/ a new line (don't separate long string into a series of short strings). Basically I want the function of the module, only with a single string. I can't simply replace the /n char with // because this causes problems with...
I have an app which requires 4 separate chunks of input data, with each dataset being separated by a series of special characters, i.e.111 or xxx or some such.
I know how to split a string into separate variables, but since the datasets here will be considerably larger (10,000 chars), I have the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.