Sources on this Page

> Headlines by Category

 Home / Technology / Software


You are using the plain HTML view, switch to advanced view for a more complete experience.

NIST spotlights five actors in the cloud
Describing cloud services can be daunting. The NIST simplifies this process by breaking down major cloud actors into five types.
German Publishers Back Down Over Payment After Google Snippet Removals
The German publishers thought they were negotiating from a position of strength when the wanted Google to pay for use of the snippets. ...
Bing: Trust and Authority Usually Sees Higher Rankings
Building trust and authority are two key aspects of any online program and site development. Find out what Bing had to say on the topic. ...
Word OLE add Comments

    Dear Monks

    I know that my question is not so relevant for Perl, but I really can't find any other information on the Web, so I hope to fine a monk wanting to help me out.

    I need to insert in a Word document comments for words matching a RegExp. So far I put together the following script which is working fine. It highlight all instances of that word in the document. What I'd like to do is to add a comment for that words. I don't find any info for that. Can you point me to the right direction?

    #!/usr/bin/perluse strict;use warnings;use Win32::OLE;use Win32::OLE::Const 'Microsoft Word';$Win32::OLE::Warn = 3;my $word = get_word();$word->{Visible} = 1;my $doc=$word->Documents->Open('D:/test.docx');my $WordToLookup="xy";FindAndReplace();sub FindAndReplace{$word->Selection->HomeKey(wdStory);$word->Selection->Find->{'Text'}=$WordToLookup;$word->Selection->Find->Replacement->{'Highlight'}=1;$word->Selection->Find->Execute({Replace=>wdReplaceAll});}sub get_word {my $word;eval {$word = Win32::OLE->GetActiveObject('Word.Application');};die "$@n" if $@;unless(defined $word) {$word = Win32::OLE->new('Word.Application', sub { $_[0]->Quit +})or die "Oops, cannot start Word: ",Win32::OLE->LastError, "n";}return $word;}
split (grep)

    This is driving me crazy... I'm ultimately trying to read in two lists, one with a single column of ordered names... The second list is a column of names with a comma separated (this test script is using semi-colons) value after the name...
    If I were able to do this in unix I would be:

    grep -f file1 file2
    Which is ok, but file1 loses it's order to file2, and what I really want to do is print values from file2 next to the order in file1... so I need to split off values and print the results next to the members of file1 where there is a match...
    But it seems like today I'm too stupid to figure out how to do the split command correctly... Or, other... I could just print the line from list2, but there could be many values and I need to split them out to do math on them after I figure out the problem with split... perldoc -f split tells me it's returning the number of times each line succeeds, where I need to be able to manipulate the results. I've been searching the site for something similar, with no success. Thank you for any help in advance.

    my $a;my @foo = qw/tom steve bill roger bob/;my @bar = qw/roger;99 steve;56 ted;88 tom;54/;for($a=0;$a<@foo;$a++) {printf("%s %sn",$foo[$a],grep(/$foo[$a]/,@bar));}print "----n";for($a=0;$a<@foo;$a++) {# printf("%sn", grep(/$foo[$a]/,@bar) );printf("%sn", (split /;/, grep(/$foo[$a]/,@bar))[0] );}--output before split--tom tom;54steve steve;56billroger roger;99bob----tom;54steve;56roger;99--output using split--tom tom;54steve steve;56billroger roger;99bob----11010
FromDual.en: MySQL Environment MyEnv 1.1.2 has been released
Taxonomy upgrade extras: myenvoperationMySQL Operationsmulti instanceconsolidationBackupcatalog

FromDual has the pleasure to announce the release of the new version 1.1.2 of its popular MySQL, Galera, MariaDB and Percona Server multi-instance environment MyEnv.

You can download MyEnv from here.

In the

  [Read more...]
Delete "/" in a string

    Hi Monks,I just subscribed here a few minutes ago seeking for help >< I am recently getting into perl for my work since a couple of weeks now.And like not super smart people, there is at least a first time when we need help for something dump ...The problem I'm into is this :

    As parameters of a command that I created with perl, the user enter an interface name of a cisco router and his IP adress, then I put them an a variable like $ip = and $interface = POS1/0/0

    Now what I want to do is to create a .txt file as follow : $filename = "$ip--$interface.txt" but without "/" (obviously).As a result I should have a file named :

    In short, how can I change $interface = "POS1/0/0" into $interface = "POS100" ??

    Looks simple saying like this but I really need help in this.Thank you very much for your time and help ^^

perl threads & memory

    What's wrong with perl threads?

    If I run this code :

    use threads;sub my_sub() {return 1;}while (1) {my $thr=threads->create(&my_sub);my @res=$thr->join();}

    Within 5 minutes my heap has grown to over 50MB and keeps growing...

Post Selected Items to:

Showing 10 items of about 68000

home  •   advertising  •   terms of service  •   privacy  •   about us  •   contact us  •   press release design by Popshop •   Official PR partner B2BLogger.com •   © 1999-2014 NewsKnowledge