Posts
 
Reputation
Joined
Last Seen
Ranked #276
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
100% Quality Score
Upvotes Received
103
Posts with Upvotes
93
Upvoting Members
57
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
37 Commented Posts
3 Endorsements
Ranked #486
Ranked #130
~236.12K People Reached
About Me

Born in Toronto, CANADA. Attended elementary and high school in Smiths Falls, B.A. at University of Toronto in philosophy and psychology. Met and married Franceen in Montreal. Worked as Programmer/Analyst in Montreal and down south in Georgia, USA. Returned…

Interests
Reading blogs, books, philosophy, psychology, futurism.
PC Specs
HP notebook computerModel: G60-230CAUbuntu 10.04 LTS - the Lucid Lynx
Favorite Tags
perl x 626
mysql x 71
php x 31
regex x 27
Member Avatar for JerieLsky

I can't point to an authority to back me up, but my guess is that we discover the one-one vs. on-many relationship by studying the PRIMARY key of the tables in question. Because the values of the primary keys of the two tables do not have to be identical between …

Member Avatar for Inderjeet_2
1
8K
Member Avatar for alan_123

[CODE=perl]#!/usr/bin/perl -w #ReplaceBackslashWithSlash.pl use strict; my $myPath = 'c:\perl\test'; # Example string containing backslashes print "\nOriginal string is: $myPath\n\n"; # The following command substitutes backslashes with forward slashes # You need to escape the backslash and slash with backslash $myPath =~ s/\\/\//g; print "Modified string is: $myPath\n";[/CODE]

Member Avatar for Taywin
0
6K
Member Avatar for prashantkaushal

I don't know but you could start by finding your httpd.conf file and having a look at [URL="http://serverfault.com/questions/29942/xampp-on-windows-permission-problems"]this post[/URL] in case the solution to that person's problem throws light on yours.

Member Avatar for Samuel_6
0
7K
Member Avatar for A_Dubbs

I think you can use pretty much the same list that you used for the simpler problem. All you need to come up with is a formula to calculate the index for each grade. [code=PYTHON] def main(): grade = raw_input("Enter the student's grade: ") index = int(grade)/10 grades = ["F", …

Member Avatar for vegaseat
0
13K
Member Avatar for Richtofen345

Maybe the PHP configuration on the server running your script tells PHP not to display any errors (although I don't see any errors in your script.) Try adding the following line to the beginning of your script: [iCODE]ini_set('display_errors', 1);[/iCODE] [URL="http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html"]http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html[/URL]

Member Avatar for Deepika_6
0
2K
Member Avatar for red711

I'll have another look when I get some time but the first thing I'd suggest: [CODE]use strict; use warnings;[/CODE] belong in every non-trivial Perl script. Add them to your script and declare any undeclared variables, such as @sesname, @title1, @all, @title2 and $i. Another general suggestion: when opening files, use …

Member Avatar for 2teez
1
551
Member Avatar for mrnutty

I used to have @david_ellis on Twitter and I thought if I made it shorter people would retweet me more often. (This was before Twitter came up with their new retweet action that doesn't include the posters handle in the character count.) I shortened it to @d5e5 because my first …

Member Avatar for Reverend Jim
0
681
Member Avatar for teedoff

For a table named 'items':[CODE]update items set itemName = replace(itemName,'/','');[/CODE]

Member Avatar for BASHA`
-1
140
Member Avatar for iacosar

The following may not exactly correspond to what you mean by 'numeric' but it will serve as an example of what the Scalar::Util module can do. #!/usr/bin/perl use warnings; use strict; use Scalar::Util qw(looks_like_number); while (my $teststring = <DATA>){ chomp $teststring;#Remove newline character from end of string if (looks_like_number($teststring)){ print …

Member Avatar for d5e5
0
172
Member Avatar for Aditya_MUHAHA

#!/usr/bin/perl use warnings; use strict; my $path = <DATA>; chomp($path); print 'Original path: ', $path, "\n"; $path =~ s/"/'/g;#Replace all " with ' print 'Changed path: ', $path, "\n"; __DATA__ "C:\Users\ABC\XYZ\1.txt"

Member Avatar for 2teez
0
199
Member Avatar for predator78

[QUOTE=Ancient Dragon;1570084]The best at what? Best communist country? Might be, I don't know. But I hear people in Russia have very limited food in their stores with long lines to buy anything. That's what I hear from here. >>Could you please explain how this can be when the gap between …

Member Avatar for mike_2000_17
2
728
Member Avatar for perly

Look closely at lines 16 - 17. my $Header; $hash{$Header} = $_; You declare a lexical variable called $Header and assign no value to it, so its value is undefined. Then you use $Header (whose value is undefined) as a key to $hash. In effect you are assigning all the …

Member Avatar for 2teez
0
260
Member Avatar for jassipox

You may also want to look at the [Bio::DB::Fasta](http://search.cpan.org/~cjfields/BioPerl-1.6.901/Bio/DB/Fasta.pm) module. I haven't tried it but according to the docs it has the following method to extract specific substrings from fasta files: > $raw_seq = $db->seq($id [,$start, $stop]) > Return the raw sequence (a string) given an ID and optionally a …

Member Avatar for d5e5
0
253
Member Avatar for caven.chunyen_1

I would create a text file in comma separated values (or tab-separated if you prefer) format extension because I find it easier to write text files. Then you can start up Excel and import the movies_or_whatever.txt file into a sheet using Excel and save it as an Excel file.

Member Avatar for 2teez
0
115
Member Avatar for aecha

What data are you trying to read? Please post an example of your input data and some example code showing how you try to read it. I don't know much about XML and nothing about soap but maybe somebody here does and can help you if you provide relevant information.

Member Avatar for d5e5
0
116
Member Avatar for msrikanth

OpenOffice::OODoc looks like the module you need to install and learn how to use. I have no expertise with it so if you don't want to learn how to do it yourself I think you may need to hire a programmer with the relevant experience to write a script that …

Member Avatar for d5e5
0
339
Member Avatar for Violet_82

Scripting makes it easier to do something that we repeatedly do, so what scripting language would serve you best depends on your answer to the question what do you do repeatedly that has several steps, that you would like to do in fewer steps, automatically? As Aristotle said, ["We are …

Member Avatar for Violet_82
0
163
Member Avatar for neerajte

In general I would try to tailor the complexity of the solution and extent of explanation to the apparent knowledge level of the person posing the question. However, figuring out what the poster needs to know is a two-way street. If someone posts a vague and hastily-written question and never …

Member Avatar for dkhalfe
-1
2K
Member Avatar for perllearner007

> Any simple ways to get hyperlinks using perl without the HTML table? Yes. What's wrong with the example shown in the [docs](http://search.cpan.org/~gaas/libwww-perl-6.04/lib/LWP/Simple.pm)? use LWP::Simple; $content = get("http://www.sn.no/"); I assume that you want to retrieve the html content from the site refered to in a given hyperlink, right? If the …

Member Avatar for d5e5
0
125
Member Avatar for codeblock

The following script creates a table (if it doesn't already exist) and saves all the image names (extension included) and the directory names. #!/usr/bin/perl use strict; use warnings; use DBI; use File::Glob ':glob'; use File::Basename; my $dbh=DBI->connect('dbi:mysql:daniweb','david','dogfood') || die "Error opening database: $DBI::errstr\n"; $dbh->do("CREATE TABLE IF NOT EXISTS images (id …

Member Avatar for codeblock
0
185
Member Avatar for perllearner007

You could write your subroutines as values in a hash in your script and then run it from the commandline with the name of your desired function as the first argument on the command line. For example, a script named many_functions.pl #!/usr/bin/perl use warnings; use strict; my %funcs = (thisismyfunction1 …

Member Avatar for perllearner007
0
147
Member Avatar for Serpterion

In Perl I would change the value of the special variable representing the input record separator $/ to '!' to read entire records instead of one line at a time. Then you need only one loop within which you can use regex to capture values into variables. #!/usr/bin/perl use warnings; …

Member Avatar for d5e5
0
134
Member Avatar for PhoenixInsilico

If you run perl and your script from the command-line interface in a DOS window or a Terminal in linux and print to STDIN then maybe the DOS or Terminal can't print those characters. I think that depends on the platform. However if you print something encoded as utf-8 to …

Member Avatar for 2teez
0
96
Member Avatar for Serpterion

Multi-line records with no record separator make it tricky. As for writing CSV output it's worth installing the [Text::CSV](http://search.cpan.org/~makamaka/Text-CSV-1.21/lib/Text/CSV.pm) module if you don't already have it. #!/usr/bin/perl use warnings; use strict; use Text::CSV; my $csv = Text::CSV->new ( { binary => 1 } ) # should set binary attribute. or …

Member Avatar for Serpterion
0
187
Member Avatar for perly

> open my $fh, '&lt;', $file1 or die "can't open $file1:$!"; Why do you have statements like the above where I see '&lt;' instead of '<'? Besides fixing the above, mostly all you need to do to get what you want is to switch the filenames, as follows: #!/usr/bin/perl use …

Member Avatar for perly
0
221
Member Avatar for perly

If one of 2teez's scripts works for you with the large files, good. Otherwise you could try the following modified version. When working with large files you need to consider memory limitations vs. speed. I think 2teez's scripts make good use of memory but take a bit longer than using …

Member Avatar for perly
0
204
Member Avatar for tonyprotop

> I face some real problems here. I need a Perl script that can open a text file, read a series of URLs, get the content of the pages and save it to another file. Divide your task into steps, such as: 1. open a text file 2. read a …

Member Avatar for tonyprotop
0
177
Member Avatar for achava

> suppose my input string is "a*b+c/\/" and I want a Perl regex expression to match it. #!/usr/bin/perl use warnings; use strict; my $x = 'String of 8 words including numbers and letters'; my $y = 'String including characters like a*b+c/\/ plus text'; my $z = 'Some numbers 7, 8 …

Member Avatar for 2teez
0
301
Member Avatar for abulut

> Thanks for helping .. could you pls order them time by time. Also they should be from the new time to last time abulut, Do you mean you want them ordered by a combination of date and time? Should 2012-03-16 14:29:54.61 print before (above) 2012-04-23 07:16:21.83 for example? Normally …

Member Avatar for abulut
0
128
Member Avatar for vivek.vivek

Start by reading both files into a suitable data structure (see [the data structure cookbook](http://perldoc.perl.org/perldsc.html#HASHES-OF-HASHES)). Then you can read and test values from your data structure to print the details of your report. #!/usr/bin/perl use strict; use warnings; @ARGV = qw(FILE1.txt FILE2.txt); my %HoH; #Hash of hash references while (my …

Member Avatar for d5e5
0
352