- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
6 Posted Topics
[CODE]use strict; use warnings; use 5.010; my @sentences = <DATA>; #reads everything after __DATA__ below my $str = 'control'; my @results = reverse sort by_str_matches @sentences; sub by_str_matches { my @a_matches = $a =~ /$str/g; my @b_matches = $b =~ /$str/g; @a_matches <=> @b_matches; } print for (@results); __DATA__ __DATA__ …
[QUOTE=SergioQ;1060636]Hi All, So I use Net::POP3 to look into my email server. What I wanted to know is if there is any module that allows me to MODIFY the email messages? Sure between Mail:: and Net::POP3 I can forward them, delete them, etc. But would love to be able to …
[quote]new() : [code] my $sortscheme = sub { $Sort::External::b <=> $Sort::External::a }; my $sortex = Sort::External->new( mem_threshold => 1024**2 * 16, # default: 1024**2 * 8 (8 MiB) cache_size => 100_000, # default: undef (disabled) sortsub => $sortscheme, # default sort: standard lexical working_dir => $temp_directory, # default: see below …
[QUOTE=k_manimuthu;1043850][CODE] my $FP = 'D:\conv'; my $TP = 'D:\sgml_db'; my $cwd = `cd`; # Get current working directory my ($from_dir, $to_dir) = ($cwd, $cwd); # if your current working directory ($to_dir) doesn't have 'D:\conv' the below line doesn't change the value of $to_dir. # So $to_dir equals to current directory …
[QUOTE=Vandithar;1042620]HI, I have a string like this. These are the set of phrases enclosed in double quotes: [code] $str="\"rna binding protein\" OR \"Transcription factor\" "; [/code][/quote] You don't ever need to escape interior quotes in perl. In your case, you could use single quotes as the outer quotes or q{}. …
[CODE]open(my $INFILE, '<', 'data2.txt'); my (@col1, @col2, @col3); while (<$INFILE>) { next if /^\s*$/ or /^\./; chomp; my @pieces = split /\s+/; push (@col1, shift @pieces) if @pieces == 3; push @col2, $pieces[0]; push @col3, $pieces[1]; } say "@col1"; say "@col2"; say "@col3"; --output:-- BANANAS CHEESE JENNY ARE IS IS …
The End.
7stud