Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6173761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:37:53+00:00 2026-05-23T23:37:53+00:00

#! /usr/bin/perl use strict; use warnings; #Always use these! my @no = (1 ..

  • 0
#! /usr/bin/perl 
use strict;
use warnings; #Always use these!
my @no = (1 .. 100); 
foreach(@no) { 
print   "\#world" . $_ . " \{
        background: url(/images/1.png) 0 0 no-repeat;
        float: left;
        width: 1%;
        height: 2%;
        position: absolute;
        top: " . $_ . "\%;
        left: " . $_ . "\%;
        z-index: -1;
        margin-top: -10px;
        margin-left: -10px;
    \}

    \#world" . $_ . ":hover \{
        background-position: 0 -20px;
        cursor: pointer;
    \}"; 
}

currently this perl script outputs #world1, top: 1%; left: 1%; where the percentages are the same. How can i modify the script to output world(1 through to 100) top: 1%; left: (1% through to 100%)%; world(101 through to 201) top: 2%; left: (1% through to 100%)%; up to world(19001 through to 20000) top: 100%; left: (1% through to 100%)%;

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:37:54+00:00Added an answer on May 23, 2026 at 11:37 pm

    This will add a unique number for $world for every top/left value pair.

    my $world = 1;
    for my $top (1 .. 100) {
        for my $left (1 .. 100) {
             # print here... world$world top = $top, left = $left...
             $world++;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider: #!/usr/bin/perl use strict; use warnings; my %hash; foreach (1 .. 10) { $hash{$_}
#!/usr/bin/perl use strict; use warnings; my @array = qw[a b c]; foreach my($a,$b,$c) (@array)
If I have an array and hash like these #!/usr/bin/perl use warnings; use strict;
i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my
This code triggers the complaint below: #!/usr/bin/perl use strict; use warnings; my $s =
!/usr/bin/env perl use warnings; use strict; my $text = 'hello ' x 30; printf
Which version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my
#!/usr/bin/perl use strict; use warnings; open(my $vmstat, /usr/bin/vmstat 1 2>&1 |); open(my $foo, >,
#!usr/bin/perl use strict; use warnings; my $file_name = rem.txt; open(FILE, $file_name); while (<FILE>) {
#!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML::Reader; my $reader = XML::LibXML::Reader->new(

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.